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
LVL 1
mmanningAsked:
Who is Participating?
 
sda100Commented:
I forgot to add... change the end of the batch file, include the extra line to delete the registry file after use.

del %regfile%
set regfile=

Steve :)
0
 
jkrCommented:
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.
0
 
sda100Commented:
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 :)
0
 
jkrCommented:
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
0
 
mmanningAuthor Commented:
Many Thanks sda100  Spot on.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.