OK, here's something to try:
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"
Next
End Sub
Dim mmachineNames()
Const NumMachines =2
redim 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 :P
mmachinenames(1) = "SATELLITE"
on error resume next
Dim I ,X
'for each machine in mmachinenames
For 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
next
wScript.stdOut.WriteLine "Script finished. Successfully processed " & X & " of " & ubound(mmachinenames)+1 & " Machines."
You'll still need to use the batch, to copy the screensaver. And then you can, instead of using REG ADD in your batch script, run "Cscript newscript.vbs"
remember, however, to modify the lines:
Const NumMachines =2
and
mmachinenames(0) = "." 'this reflects the local machine. This was for my testing, change it :P
mmachinenames(1) = "SATELLITE"
to reflect the names of the PCs your fiddling with on the network, as well as the number.
In my testing I was getting permission denied when it tried to change my laptop, "SATELLITE"'s, registry. I think it was simply the way I had things configured- not necessarily a network setup.
I hope the remote portions work for you. It reports the number that suceed after the script runs- (it doesn't quit of one fails, so if, say, one of the PCs is off, it won't simply stop there).