PDA

View Full Version : Automated Proxy changes (WXP-Pro)



Wrk
05-09-2003, 07:02 AM
Hey all.

I have a Cpq Armada m700 notebook with a built-in NIC. I also have a docking station (one of those really cool motorized ones :) ) at work, with a PCI NIC in it. At work, I use a proxy, and I use the NIC in the docking station. At home, I use the on-board NIC, and no proxy.
Is there a way to easily switch between proxy/no proxy without having to go into the Internet Settings dialog? I'm thinking possibly a reg hack?
Or even better - is there a way to tell WXP to use proxy on the PCI NIC, and no proxy on the on-board NIC?

Thanks in advance, everybody!

jdharm
05-21-2003, 03:14 PM
Copy and paste the following bold type into notepad and save as a *.vbs file on your desktop. When you run it make sure that all IE windows are closed to ensure the settings take effect.

-----------copy below-------------

Option Explicit

Dim WSHShell, RegKey, Prox, Result

Set WSHShell = CreateObject("WScript.Shell")

RegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Int ernet Settings\"

Prox = WSHShell.RegRead (regkey & "ProxyEnable")

If Prox = 1 Then 'Proxy is Enabled

Result = MsgBox("Your proxy use is enabled." & _
vbNewLine & "Would you like to disable it?", 36)

If Result = 6 Then 'clicked yes
WSHShell.RegWrite regkey & "ProxyEnable", 0, "REG_DWORD"
End If

Else 'Proxy is Disabled

Result = MsgBox("Your proxy use is disabled." & _
vbNewLine & "Would you like to enable it?", 36)

If Result = 6 Then 'clicked yes
WSHShell.RegWrite regkey & "ProxyEnable", 1, "REG_DWORD"
End If

End If




Josh
<a target="_blank" href=http://www.jdharm.net>www.jdharm.net</a>