1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36:
'Example use of IEautomaticallydetect IEautomaticallydetect "off" IEautomaticallydetect "show" IEautomaticallydetect "on" IEautomaticallydetect "show" wscript.quit SUB IEautomaticallydetect (status) 'howeasyisthat.com 'The parameter shold be set to 'off', 'on' or 'show'. 'This reads and writes to HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings in order to 'set or read the Internet Explorer Automatically Detect facility. When a proxy is set, this should normally be off. When no proxy settings are set, 'it's usually best to have this setting turned on.[/size] DIM sKey,sValue,binaryVal Dim oReg Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") 'For registry operations througout Const HKCU=&H80000001 sKey = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections" sValue = "DefaultConnectionSettings" oReg.GetBinaryValue HKCU, sKey, sValue, binaryVal select case lcase(status) case "on" binaryVal(8) = binaryVal(8) OR 8 'Force Autodetect on case "off" binaryVal(8) = binaryVal(8) XOR 8 'Force Autodetect off case "show" wscript.echo "Automatically detect is set to " & ((binaryVal(8) and 8) = 8) case else wscript.echo "Invalid parameter - IEautomaticallydetect on, off or show" end select if lcase(status)="on" or lcase(status)="off" then oReg.SetBinaryValue HKCU, sKey, sValue, binaryVal end sub