# Use logon.bat to REMOVE proxy settings

I have inherited a network which had been using a proxy sever (192.168.0.1:8080). The proxy server has died and I want to force all users to connect without the proxy. Rather than doing this on each machine I wish to modify the logon.bat file.

What should I put into the .bat file to clear the existing settings and return everything to a clear network?

(Windows 2003 Server environment, Windows XP clients)

-

To clear the proxy you could use a registry file that the script calls to set the proxy to off.

Add this to a .reg file and run it at logon.

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000000


Alternatively a vbs file to run and turn it off:

Option Explicit
Dim WSHShell, strSetting
Set WSHShell = WScript.CreateObject("WScript.Shell")

WSHShell.regwrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"


This is not my code and should be checked thoroughly although with a quick glance it seems fine.

You could use GPO's to change all settings on the machines though. This would be much simpler if you're comfortable with Group Policy.

Hope it helps

-

Some places also set the proxy via group policy under IE settings. Also, you can set proxy settings via DHCP and http with whats called WPAD config: http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol

Just thought I would mention, in case it was deployed via GPO, if you delete the registry keys, it will come back on the next policy refresh.

-