asked on
dim strComputer, arrKeyPaths, strValueName, strValue
arrKeyPaths = Array(_
"SOFTWARE\Microsoft\SMS\Client\Client Components\Remote Control\User Settings",_
"SOFTWARE\Microsoft\SMS\Client\Client Components\Remote Control")
strKey="Permission Required"
' Read computer name from argument supplied - if no argument, assume local machine
if WScript.Arguments.Count<1 then
strComputer="."
else
strComputer=WScript.Arguments(0)
end if
Const HKEY_LOCAL_MACHINE = &H80000002
dim oReg: Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
for i=0 to UBound(arrKeyPaths)
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,arrKeyPaths(i),strKey,1
next