This question is outside the scope of this site and needs to be asked either on Technet or MSDN
VBscript - how to Disable "Use Automatic configuration Script"
Hi There
I currently have the below script in a vbs file;
Const HKEY_CURRENT_USER = &H80000001
Set objShell = CreateObject("WScript.Shell")
strPC = objShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
On Error Resume Next
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\.\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings"
strValueName = "ProxyEnable"
objReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
'#==============================================================================
'# If IE Proxy is currently enabled display message and ask user whether it
'# should then be disabled
'#==============================================================================
If dwValue = 1 Then
IEPrompt = MsgBox ("Hello David. Your Proxy is on, Do you want to turn it off?", vbQuestion+vbYesNo, "Disable IE Proxy")
If IEPrompt = vbYes Then
dwValue = 0
objReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
MsgBox "Thank You David, your proxy is now off. Have a nice day" & _
".",vbInformation, "Disable IE Proxy"
ElseIf IEPrompt = vbNo Then
MsgBox "David, your Proxy is still on " & _
".",vbInformation, "Disable IE Proxy"
End If
'#==============================================================================
'# If IE Proxy is currently disabled display message and ask user whether it
'# should then be enabled
'#==============================================================================
ElseIf dwValue = 0 Then
IEPrompt = MsgBox ("Hello David. Your Proxy is off, Do you want to turn it on?", vbQuestion+vbYesNo, "Enable IE Proxy")
If IEPrompt = vbYes Then
dwValue = 1
objReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
MsgBox "Thank You David, your proxy is now on. Have a wonderful day" & _
".",vbInformation, "Enable IE Proxy"
ElseIf IEPrompt = vbNo Then
MsgBox "David, your Proxy is still on" & _
".",vbInformation, "Enable IE Proxy"
End If
End If
This only turns off the proxy server in IE/Tools/Internet Options/Connections/Lan Settings.
Can I get this same code to turn of the 'Automatic configuration' check boxes instead or as well?
Many thanks
Luke
Windows for home | Windows 11 | Internet and connectivity
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author