Hi I have started a script which I hope to use on users laptops to allow a simple solution to change the proxy settings for work and home. It sort of works but sometimes fails could someone take a look and point me in the right direction.Script below
<Dim objWSch
Set objWSch = Wscript.CreateObject("Wscript.Shell")
Set ShellObj = WScript.CreateObject("WScript.Shell")
Dim strProxy, strNewProxy
strProxy = objWSch.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer")
If strProxy=" : " Then
strNewProxy = "proxy.gfl.suffolk.xxx.xxx:8084"
Else
ShellObj.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer", " : "
ShellObj.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable",0
End if
objWSch.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer",strNewProxy
objWSch.Popup "Proxy is now " & strNewProxy, 3, "Swap Proxy Settings", 1
WScript.Quit>
THANKS
Only the GOOD die young,
Me? I'm here forever!
<Dim objWSch
Set objWSch = Wscript.CreateObject("Wscript.Shell")
Set ShellObj = WScript.CreateObject("WScript.Shell")
Dim strProxy, strNewProxy
strProxy = objWSch.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer")
If strProxy=" : " Then
strNewProxy = "proxy.gfl.suffolk.xxx.xxx:8084"
Else
ShellObj.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer", " : "
ShellObj.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable",0
End if
objWSch.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer",strNewProxy
objWSch.Popup "Proxy is now " & strNewProxy, 3, "Swap Proxy Settings", 1
WScript.Quit>
THANKS
Only the GOOD die young,
Me? I'm here forever!