Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Internet Explorer Command Line Switchs

Status
Not open for further replies.

chrisperkins

IS-IT--Management
Feb 25, 2004
21
0
0
CH
Does anybody know if there is a command line switch that I can add to a desktop shortcut that enables the proxy server in the connections tab or alternatively unchecks the proxy server setting.

The reason is that I have two independent internet connections that are on two separate networks & it becomes a real pain having to keep going to the Internet Options and turning on/off the proxy server. I have tried something like netswitcher, but it did not seem the most stable of systems.

Any suggestions anyone?

Cheers,
Chris
 

Are there Command line switchs for internet explorer?
faq608-3525

The easist solution might be to use 2 browsers - IE and some other. A little more info of your 2 network setup might help bring out more ideas.
 
You might consider creating a batch file that modifies the registry to enable/disable the proxy, then launch IE. For example, with this batch file you could run "proxy off" to disable the proxy, or just "proxy" to enable it:

****Proxy.cmd**********
@echo off
if %1.==off. goto off
if %1.==Off. goto off
if %1.==OFF. goto off
REM The default is ON

echo Proxy on
reg update "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"="1"
start iexplore
goto :eof

:eek:ff
echo Proxy off
reg update "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"="0"
start iexplore
 
I tried the batch file solution as it seemed the most elegant, but my windows XP machine does not recognise the "reg update" line. When I go to a dos prompt and type reg /?" it list various types - but alas not one of them is "update".

Any further suggestions,

Chris
 
I found this page handy:


Based on that page, I would suggest using notepad or command-line edit to create the following two registry files:

(Please note: My lines of dashes are delimiters - do NOT actually use the dashes...)

proxy-off.reg:
-----------------------------------------------------------
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000000
-----------------------------------------------------------

proxy-on.reg:
-----------------------------------------------------------
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
-----------------------------------------------------------

Save these somewhere... I'll use c:\windows\ for this example...

Then, create yourself a batchfile... maybe "ieproxy.bat", and save it also to c:\windows (just to put it in the path, so you can Start->Run "ieproxy [on|off]"...)

-----------------------------------------------------------
@echo off
if %1.=off. goto off
if %1.=OFF. goto off
if %1.=Off. goto off
if %1.=on. goto on
if %1.=ON. goto on
if %1.=On. goto on
echo.
echo To start IE with proxy on, enter "ieproxy on".
echo.
echo To start IE with proxy off, enter "ieproxy off".
echo.
pause
goto end
:eek:ff
regedit /s c:\windows\proxy-off.reg
start iexplore
goto end
:eek:n
regedit /s c:\windows\proxy-on.reg
start iexplore
goto end
:end
cls
exit
-----------------------------------------------------------

Please do test this carefully. I have not tested this specific implementation, because it doesn't apply to my sitch...

(I have tested importing registry settings this way - but again, test for yourself, as screwing up the registry is a LOT easier than fixing it... Go in and export yourself a backup copy before you test this the first time, willya?)

Hope it helps. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top