|
|
|
| 30 May 2003 | SetIEAutoDetect() |
| Author | Bill Stewart (Albuquerque, NM) |
| Action | Toggles the "Automatically detect settings" check box for IE. |
| Syntax | SetIEAutoDetect ($enable) |
| Parameters | |
| Remarks | Toggles the appropriate bit in the registry setting HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings (REG_BINARY). |
| Returns | 0 for success; non-zero for failure |
| Dependencies | None. |
| Examples | $rc = SetIEAutoDetect(1) ; Enable $rc = SetIEAutoDetect(0) ; Disable |
| Source |
FUNCTION SetIEAutoDetect ($enable)
DIM $subkey, $value, $bit, $rc
$subkey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
$value = ReadValue($subkey, "DefaultConnectionSettings")
$rc = @error
IF $rc = 0
$bit = Val(Substr($value, 18, 1))
$bit = IIF($enable, $bit | 8, $bit & 7)
$value = Substr($value, 1, 17) + DecToHex($bit) + Substr($value, 19, Len($value) - 18)
$rc = WriteValue($subkey, "DefaultConnectionSettings", $value, "REG_BINARY")
ENDIF
$setieautodetect = $rc
ENDFUNCTION ; - SetIEAutoDetect -
|
|
|
|