jagreygoose icon

Proxy Snippet

jagreygoose | PRO | 06/12/14 10:17:40 AM UTC | 0 ⭐ | 9401 👁️ | Never ⏰ | []
AutoIt |

1.27 KB

|

None

|

0 👍

/

0 👎

#include <MsgBoxConstants.au3>
 
local $PAC = "http://10.0.84.24/proxy.pac"
local $regKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
local $regError = ""
local $errorTitle = ""
Local $msgTimeout = 3
 
If @OSArch <> "X86" Then $regKey = "HKEY_CURRENT_USER64\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
 
RegWrite($regKey, "ProxyServer", "REG_SZ", "")
RegWrite($regKey, "ProxyEnable","REG_DWORD", "0")
RegWrite($regKey, "AutoConfigURL", "REG_SZ", $PAC)
 
Switch @error
    Case 1 
        $regError =  "Unable to open requested key"
        $errorTitle = "Error" 
 
    Case 2
        $regError = "Unable to open requested main key"
        $errorTitle = "Error" 
    Case 3
        $regError = "Unable to remote connect to the registry"
        $errorTitle = "Error" 
    Case -1 
        $regError = "Unable to open requested value"
        $errorTitle = "Error" 
    Case -2
        $regError = "Value type not supported"
        $errorTitle = "Error" 
    Case 0 
        $regError = "Fixed! Enter a new URL into the browser"
        $errorTitle = "Success" 
    Case Else
        $regError = "Unexpected Error"
        $errorTitle = "Error" 
EndSwitch
 
DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)
 
MsgBox($MB_SYSTEMMODAL, $errorTitle, $regError, $msgTimeout)

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎