Script to configure IE setting for auto detect LAN
As I was recently doing some cleanup of old files and or scripts that I’ve written years ago, I came across the below script to change a users IE auto detect LAN.
' This script launches IE (hidden) then changes the auto detect LAN settings ' Written by Nick Moseley on 1/10/11 Const HKCU = &H80000001 Dim oReg, oShell Set oReg= GetObject("Winmgmts:root\default:StdRegProv") Set oShell = CreateObject ("WScript.Shell") ' Launch IE Dim sIeExe sIeExe = """C:\Program Files\Internet Explorer\iexplore.exe""" oShell.Run sIeExe, 0, False WScript.Sleep 30000 ' Get the binary regkey Dim sKeyPath, sValueName, sKeyValue, iRetVal1, iRetVal2 sKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections" sValueName = "DefaultConnectionSettings" iRetVal1 = oReg.GetBinaryValue (HKCU,sKeyPath,sValueName,sKeyValue) ' Set array position 9 to value 9 sKeyValue(8)=1 'write new value to registry iRetVal2 = oReg.SetBinaryValue(HKCU,sKeyPath,sValueName,sKeyValue)