Is there a way to set the proxy server of a machine at login? I found the
'SetProxySetting' in the 'Win32_Proxy Class' on the MSDN site but I dont
know how to implement it.
Thanks,
Grant
Here is a couple of functions I used to change the registry, see if what
you need is in there ;-)
<snip>
Function DisableProxy()
Set WshShell = WScript.CreateObject("WScript.Shell")
MyValue =
WshShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\proxyenable")
If MyValue = 1 Then
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\proxyenable", 0 ,"REG_DWORD"
WshShell.RegWrite "HKLM\Software\Microsoft\Firewall Client\Disable", 1
,"REG_DWORD"
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\EnableAutoDial", 1 ,"REG_DWORD"
Wshshell.Regwrite
"HKEY_CURRENT_CONFIG\Software\Microsoft\windows\CurrentVersion\Internet
Settings\EnableAutodial", 1 ,"REG_BINARY"
End If
Wscript.echo "Proxy Disabled"
End Function
Function EnableProxy()
Set WshShell = WScript.CreateObject("WScript.Shell")
MyValue =
WshShell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\proxyenable")
If MyValue = 0 Then
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\ProxyEnable", 1 ,"REG_DWORD"
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\ProxyServer","myproxy server:<port no>"
WshShell.RegWrite "HKLM\Software\Microsoft\Firewall Client\Disable", 0
,"REG_DWORD"
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\EnableAutoDial", 0 ,"REG_DWORD"
Wshshell.Regwrite
"HKEY_CURRENT_CONFIG\Software\Microsoft\windows\CurrentVersion\Internet
Settings\EnableAutodial", 0 ,"REG_BINARY"
End If
Wscript.echo "Proxy Enabled"
End Function
</snip>
It's from a script I wrote for my laptop when I was at work or from home.
MyValue comes from the result of pinging the proxy.
HTH
Mike
"Grant" <gps...@hotmail.com> wrote in message
news:O$GVhYsRE...@TK2MSFTNGP09.phx.gbl...
"Grant" <gps...@hotmail.com> wrote in message
news:O$GVhYsRE...@TK2MSFTNGP09.phx.gbl...
"Grant" <gps...@hotmail.com> wrote in message
news:O$GVhYsRE...@TK2MSFTNGP09.phx.gbl...
Thanks,
Grant
"Slim" <Slim@slim> wrote in message
news:%237f2yRz...@TK2MSFTNGP09.phx.gbl...
yes there is,
here is teh pag refereing to the proxy, look at list on left for other
objects nad maby bookmark page
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_proxy.asp?frame=true
Thanks mate.
"AlanM" <noone...@nowhere.com> wrote in message
news:Os3KXv6R...@TK2MSFTNGP12.phx.gbl...
Do you know how to set this from script?
Thanks,
Grant
"Mike SMITH" <mi...@nospamtesla76.freeserve.co.uk> wrote in message
news:c9fhl7$6mk$1...@newsfeed.th.ifl.net...
I also got excited about finding that page, its makes it all a bit easier