If I edit Proxy Settings through the Control Panel, the settings are stored in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable
and ...\ProxyServer
. These settings are of course not used when running as a service under LOCAL SYSTEM
.
So I tried setting ProxyEnable
and ProxyServer
under HKEY_USERS\S-1-5-18\...
(as well as HKEY_USERS\.DEFAULT\...
and all the other users on the system), but that does not work.
How do I set the proxy settings for the LOCAL SYSTEM
user?
It is actually the value in
Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings
that is used.Since that is not easily modified, you can modify the proxy settings for a user, export the registry key, modify the path in the exported file to
HKEY_USERS\S-1-5-18
and reimport it.First, run
cmd
as administrator to open a command prompt.Command to copy proxy settings of current user to WinHttp:
To reset the proxy to default settings:
To show proxy settings of current user:
Another way, albeit much messier, is to use psexec to open a command prompt running as LOCAL SYSTEM, then from that open iexplore.exe, modify the settings appropriately.
You might want to try using ProxyCFG.EXE, which sets the proxy for any WinHTTP calls.
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyEnable" /t REG_DWORD /d "0" /f
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyServer" /t REG_SZ /d "http://procycorp.bac:80" /f
The Same thing can be done much easier in this way-