• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 981
  • Last Modified:

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
0
mmanning
Asked:
mmanning
  • 2
  • 2
1 Solution
 
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
 
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
 
mmanningAuthor Commented:
Many Thanks sda100  Spot on.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now