Link to home
Start Free TrialLog in
Avatar of mmanning
mmanning

asked on

Batch file to automatically drop the socks proxy address into the registry.

Could some one write me a file/ tell me how to do it.  I need to run the settings from a desktop ikon into IE6.

Many thanks

Marc
Avatar of jkr
jkr
Flag of Germany image

You can do that using a .reg file, i.e.

.bat:
regedit /s proxies.reg

.reg:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
ftp=192.168.0.10:80;gopher=192.168.0.10:80;http=192.168.0.10:80;https=192.168.0.10:80;socks=192.168.0.10:80
"ProxyEnable"=dword:00000001

Just provide your proxy's IP and the appropriate ports in the above. The .bat file you can either place on the desktop or create a link to it there.
Hi mmanning,

Copy this into a batch file...

@echo off
set regfile=proxy.reg
echo Windows Registry Editor Version 5.00 > %regfile%
echo [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings] >> %regfile%
echo "ProxyEnable"=dword:00000001 >> %regfile%
echo "ProxyServer"="socks=<address>:<port>" >> %regfile%
echo [HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings] >> %regfile%
echo "ProxyServer"="socks=<address>:<port>" >> %regfile%
regedit /s %regfile%
set regfile=

...then just run it from the desktop.

It only changes the proxy settings for the current user and default user (ie. new users).  I couldn't find a way to change it for all users who've already logged on (ie. system-wide).

Steve :)
Sorry, that should have been

.reg:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyServer"="ftp=192.168.0.10:80;gopher=192.168.0.10:80;http=192.168.0.10:80;https=192.168.0.10:80;socks=192.168.0.10:80"
"ProxyEnable"=dword:00000001
ASKER CERTIFIED SOLUTION
Avatar of sda100
sda100
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mmanning
mmanning

ASKER

Many Thanks sda100  Spot on.