DaveB 0 Junior Poster in Training

Hi

Writing a vbs logon script to add a registry key for users, but it is only adding it once for the SYSTEM account, (since this account is used to run logon scripts) via HKEY_CURRENT_USER, whereas I need it to add it for the user logging on, so append it to all accounts within HKEY_USERS;

current script;

const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings"
strValueName = "DialupUseLanSettings"
strValue = "1"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
 
strValueName = "DialupUseLanSettings"
dwValue = 1
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

Is there a way to modify this so for all occurances of the key path "Software\Microsoft\Windows\CurrentVersion\Internet Settings" in HKEY_USERS, it will add a new value "DialupUseLanSettings" with DWORD value 1?

Any help would be appreciated, thanks, Dave