How to Enable or Disable Proxy using a Batch File

How to Enable or Disable Proxy using a Batch File

 Tired of setting the proxy maually everytime you start your laptop?

 

Proxy1 Proxy2

 

Create a Batch File like Proxy.Bat with contents:

reg add “[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
” /v ProxyEnable /t REG_DWORD /d “0” /f

0=disable the proxy
1=enable the proxy

Command to enable proxy usage:

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ^
    /v ProxyEnable /t REG_DWORD /d 1 /f

Command to disable proxy usage:

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ^
    /v ProxyEnable /t REG_DWORD /d 0 /f

Command to change the proxy address:

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ^
    /v ProxyServer /t REG_SZ /d proxyserveraddress:proxyport /f

Command to enable proxy usage + to set/change the proxy address:

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ^
 /v ProxyEnable /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ^
 /v ProxyServer /t REG_SZ /d proxy-eudtc1.ballastham.com:8080 /f

 

 

Vista/7/2008

netsh winhttp set proxy {proxyservername}:{portnumber}
 
Removing a configured proxy can be done by using the following commands depending on your target operating system:
 

XP/2003

proxycfg -d
 

Vista/7/2008

netsh winhttp reset proxy

 

 
Reacties zijn gesloten.