Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
copy /Y "screen_saver\newSS.scr" "\\timscomputer\c$\windows\System32"REG ADD "\\timscomputer\HKCU\Control Panel\Desktop" /V SCRNSAVE.EXE /T REG_SZ /F /D "%SystemRoot%\System32\newSS.scr"REG ADD "\\timscomputer\HKCU\Control Panel\Desktop" /V ScreenSaveActive /T REG_SZ /F /D 1
1 file(s) copied.Press any key to continue . . .Error: A remote machine was specified, the root key must be HKLM or HKU.Error: A remote machine was specified, the root key must be HKLM or HKU.Press any key to continue . . .
\\U1jbennett\HKU\.DEFAULT\Control Panel\Desktop
Sub SetKeysForMachine(Byval MachineName) const HKEY_USERS = &H80000003 strComputer = MachineName Set StdOut = WScript.StdOut stdout.WriteLine "Connecting to " & machineName 'Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 'MachineName & "\root\default:StdRegProv") set oReg = GetObject("WinMgmts:{impersonationLevel=impersonate}!//" & strComputer & "/root/default:stdRegProv") strKeyPath = "" oReg.EnumKey HKEY_USERS, strKeyPath, arrSubKeys 'REG ADD "\\timscomputer\HKCU\Control Panel\Desktop" /V SCRNSAVE.EXE /T REG_SZ /F /D "%SystemRoot%\System32\newSS.scr" 'REG ADD "\\timscomputer\HKCU\Control Panel\Desktop" /V ScreenSaveActive /T REG_SZ /F /D 1 For Each subkey In arrSubKeys 'StdOut.WriteLine subkey 'save subkey\Control Panel\Desktop value, screensaveactive. strKeyPath = subkey & "\Control Panel\Desktop" strValueName = "ScreenSaveActive" strValue = "1" oReg.SetStringValue HKEY_USERS,strKeyPath,strValueName,strValue oReg.SetStringvalue HKEY_USERS,Strkeypath,"SCRNSAVE.EXE", "%SystemRoot%\System32\newSS.scr" NextEnd Sub Dim mmachineNames() Const NumMachines =2redim mmachinenames(NumMachines-1)'Change this portion, to reflect the actual number of machines (the above constant) as well as their names.mmachinenames(0) = "." 'this reflects the local machine. This was for my testing, change it :Pmmachinenames(1) = "SATELLITE"on error resume next Dim I ,X'for each machine in mmachinenamesFor I = 0 to ubound(mmachinenames) SetKeysForMachine mmachinenames(I) if err <> 0 then wScript.stdOut.WriteLine "Error processing machine, " & mmachinenames(I) Else X=X+1 end if nextwScript.stdOut.WriteLine "Script finished. Successfully processed " & X & " of " & ubound(mmachinenames)+1 & " Machines."
Const NumMachines =2
mmachinenames(0) = "." 'this reflects the local machine. This was for my testing, change it :Pmmachinenames(1) = "SATELLITE"