Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
const ALL_ENABLED = 15
const AUTO_DETECT_AUTO_CONFIG_SCRIPT = 13
const AUTO_DETECT_PROXY_SERVER = 11
const PROXY_SERVER = 3
const AUTO_DETECT = 9
const AUTO_CONFIG_SCRIPT_PROXY_SERVER = 7
const AUTO_CONFIG_SCRIPT = 5
const MSG_PROXY_SERVER = "Proxy Server is enabled"
const MSG_AUTO_CONFIG_SCRIPT = "Auto config script is enabled"
const MSG_AUTO_DETECT_SETTINGS = "Auto detect settings is enabled"
Set objRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
strValueName = "DefaultConnectionSettings"
rtn = objRegistry.GetBinaryValue(HKEY_CURRENT_USER, strKeyPath, strValueName, binValue)
dim msg
If rtn = 0 then
select case binValue(8)
case 3: msg = MSG_PROXY_SERVER
case 5: msg = MSG_AUTO_CONFIG_SCRIPT
case 7: msg = MSG_AUTO_CONFIG_SCRIPT & " and " & MSG_PROXY_SERVER
case 9: msg = MSG_AUTO_DETECT_SETTINGS
case 11: msg = MSG_PROXY_SERVER & " and " & MSG_AUTO_DETECT_SETTINGS
case 13: msg = MSG_AUTO_DETECT_SETTINGS & " and " & MSG_AUTO_CONFIG_SCRIPT
case 15: msg = MSG_PROXY_SERVER & " and " & MSG_AUTO_CONFIG_SCRIPT & " and " & MSG_AUTO_DETECT_SETTINGS
end select
wscript.echo msg
Else
wscript.echo "Error retreving registry value for host " & strcomputer
End if
|