I think someone posted something like this a while ago on a laptop thread.
It's doable in VBScript (create separate on/off shortcuts to it and using parameters for control) or an AutoIT with a basic GUI.
Edit: here's one I made earlier 8)
Code:Set WSHSHell = WScript.CreateObject("WScript.Shell") Dim Key,Phoenix,Redlist,ProxyServer,Args,Num,UseProxy Key = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\" Phoenix = "10.0.0.1:8080" Redlist = "redlist.server.pavilion.net:1669" ProxyServer = Phoenix Set Args = WScript.Arguments Num = Args.Count If Num = 0 Then MsgBox "Usage: [CScript | WScript] proxy.vbs <On|Off> <server:port> <Yes|No>" & vbCrLf & vbCrLf & "On|Off" & vbTab & vbTab & "-- Toggle access via proxy." & vbCrLf & "server:port" & vbTab & "-- Proxy server & port combo" & vbCrLf & "Yes|No" & vbTab & vbTab & "-- Confirmation of on or off message" & vbCrlf & vbCrLf & "i.e. 'proxy.vbs On 10.0.0.1:8080 Yes' to use proxy and display confirmation ", vbInformation, "Proxy" WScript.Quit 1 End If For i = 0 to Num-1 Cmd = Args.Item(i) Select Case Cmd Case "On": UseProxy = TRUE Case "Off": UseProxy = FALSE Case "Yes": Confirm = TRUE Case "No": Confirm = FALSE Case Else: ProxyServer = Cmd End Select Next If UseProxy = TRUE Then WshShell.RegWrite key & "ProxyEnable", 1, "REG_DWORD" WshShell.RegWrite key & "ProxyServer", ProxyServer, "REG_SZ" ConfirmText = "Internet access via proxy is enabled through:" & vbCrLf & vbCrLf & ProxyServer ConfirmIcon = vbInformation ConfirmCapt = "Proxy ON" ElseIf UseProxy = FALSE Then WshShell.RegWrite key & "ProxyEnable", 0, "REG_DWORD" ConfirmText = "Internet access via proxy is turned *OFF*" ConfirmIcon = vbCritical ConfirmCapt = "Proxy OFF" End If If Confirm = TRUE Then MsgBox ConfirmText, ConfirmIcon, ConfirmCapt End If



LinkBack URL
About LinkBacks
Reply With Quote
ops: 
