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"
@BC, i didn't see OP's mentioned WMI is disabled (maybe i missed), if so, wouldn't the vbscript not work as it use WMI??
He mentioned disabling WMI on a group of machines in an earlier thread....
well, VBScript might be out- because- get this-it uses WMI, and I believe you recently disabled that?oh the irony!
No that was on a different group of computers.
REG ADD "\\timscomputer\HKU\WILDCARD\Control Panel\Desktop" /V SCRNSAVE.EXE /T REG_SZ /F /D "%SystemRoot%\System32\newSS.scr"
I.E. \\REMOTEPC\HKU\SID\Control Panel\Desktop" /V SCRNSAVE.EXE /T REG_SZ /F /D "%SystemRoot%\System32\ITEP SS_UTI Version.scr"REG ADD "\\REMOTEPC\HKU\SID\Control Panel\Desktop" /V ScreenSaveActive /T REG_SZ /F /D 1
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"
oReg.SetStringvalue HKEY_USERS,Strkeypath,"SCRNSAVE.EXE", "%SystemRoot%\System32\newSS.scr"
oReg.SetValue(HKEY_USERS, strkeypath, "SCRNSAVE.EXE", REG_EXPAND_SZ, "%SystemRoot%\System32\newSS.scr"
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.SetValue(HKEY_USERS, strkeypath, "SCRNSAVE.EXE", REG_EXPAND_SZ, "%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 mmachinenames(0) = "testpc"mmachinenames(1) = "imagepc"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."
oReg.SetValue(HKEY_USERS, strkeypath, "SCRNSAVE.EXE", REG_EXPAND_SZ, "%SystemRoot%\System32\ITEP SS_UTI Version.scr"
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\ITEP SS_UTI Version.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.SetValue(HKEY_USERS, strkeypath, "SCRNSAVE.EXE", REG_EXPAND_SZ, "%SystemRoot%\System32\ITEP SS_UTI Version.scr" NextEnd Sub Dim mmachineNames() Const NumMachines =1redim 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(0) = "u1jbennett"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."
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\ITEP SS_UTI Version.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 'Next line was changed: oReg.SetValue(HKEY_USERS, strkeypath, "SCRNSAVE.EXE", REG_EXPAND_SZ, """%SystemRoot%\System32\ITEP SS_UTI Version.scr""") NextEnd Sub Dim mmachineNames() Const NumMachines =1redim 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(0) = "u1jbennett"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."
oReg.SetValue(HKEY_USERS, strkeypath, "SCRNSAVE.EXE", REG_EXPAND_SZ, """%SystemRoot%\System32\ITEP SS_UTI Version.scr""")
oReg.SetValue HKEY_USERS, strkeypath, "SCRNSAVE.EXE", REG_EXPAND_SZ, """%SystemRoot%\System32\ITEP SS_UTI Version.scr"""
1 file(s) copied.Press any key to continue . . .Microsoft (R) Windows Script Host Version 5.7Copyright (C) Microsoft Corporation. All rights reserved.Connecting to u1jbennettError processing machine, u1jbennettScript finished. Successfully processed of 1 Machines.Press any key to continue . . .
Error processing machine, u1jbennett
Usage: CScript scriptname.extension [option...] [arguments...]Options: //B Batch mode: Suppresses script errors and prompts from displaying //D Enable Active Debugging //E:engine Use engine for executing script //H:CScript Changes the default script host to CScript.exe //H:WScript Changes the default script host to WScript.exe (default) //I Interactive mode (default, opposite of //B) //Job:xxxx Execute a WSF job //Logo Display logo (default) //Nologo Prevent logo display: No banner will be shown at execution time //S Save current command line options for this user //T:nn Time out in seconds: Maximum time a script is permitted to run //X Execute script in debugger //U Use Unicode for redirected I/O from the console
cscript "%~dp0\Itep_SS.vbs"
strKeyPath = ""
I am part of a domain admin group in AD. That group is the "administrators" group on the local machines. Wouldn't that give me the proper rights to the machine? Do you think there would be any difference if it was run from the DC?
wScript.stdOut.WriteLine "Error processing machine, " & mmachinenames(I)
wScript.stdOut.WriteLine "Error processing machine, " & mmachinenames(I) & " error: " & err
I noticed in the script there is a part that looks undefined...could that have something to do with it?Code: [Select] strKeyPath = ""
1 file(s) copied.Press any key to continue . . .Microsoft (R) Windows Script Host Version 5.7Copyright (C) Microsoft Corporation. All rights reserved.Connecting to u1jbennettError processing machine, u1jbennett error: 438Script finished. Successfully processed of 1 Machines.Press any key to continue . . .
Object doesn't support this property or method
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\ITEP SS_UTI Version.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 'Next line was changed: oReg.SetValue KEY_USERS, strkeypath, "SCRNSAVE.EXE", REG_EXPAND_SZ, """%SystemRoot%\System32\ITEP SS_UTI Version.scr""" NextEnd Sub Dim mmachineNames() Const NumMachines =1redim 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(0) = "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) & "Error:" & ERR Else X=X+1 end if nextwScript.stdOut.WriteLine "Script finished. Successfully processed " & Val(X) & " of " & ubound(mmachinenames)+1 & " Machines."
1 file(s) copied.Press any key to continue . . .Microsoft (R) Windows Script Host Version 5.7Copyright (C) Microsoft Corporation. All rights reserved.Connecting to SatelliteError processing machine, SatelliteError:70Press any key to continue . . .
Connecting to u1jbennettError processing machine, u1jbennettError:438Press any key to continue . . .
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 On Error Resume Next For Each subkey In arrSubKeys Err.clear '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 'Next line was changed: oReg.SetValue KEY_USERS, strkeypath, "SCRNSAVE.EXE", REG_EXPAND_SZ, """%SystemRoot%\System32\ITEP SS_UTI Version.scr""" If Err <> 0 then stdout.WriteLine "Failed to change key " + strkeypath + " on machine " + Strcomputer stdout.WriteLine "error was " + ERROR end if NextEnd Sub Dim mmachineNames() Const NumMachines =1redim 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(0) = "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) & "Error:" & ERR Else X=X+1 end if nextwScript.stdOut.WriteLine "Script finished. Successfully processed " & Val(X) & " of " & ubound(mmachinenames)+1 & " Machines."
1 file(s) copied.Press any key to continue . . .Microsoft (R) Windows Script Host Version 5.7Copyright (C) Microsoft Corporation. All rights reserved.Connecting to u1jbennettFailed to change key .DEFAULT\Control Panel\Desktop on machine u1jbennetterror wasFailed to change key S-1-5-19\Control Panel\Desktop on machine u1jbennetterror wasFailed to change key S-1-5-19_Classes\Control Panel\Desktop on machine u1jbennetterror wasFailed to change key S-1-5-20\Control Panel\Desktop on machine u1jbennetterror wasFailed to change key S-1-5-20_Classes\Control Panel\Desktop on machine u1jbennetterror wasFailed to change key S-1-5-21-1130582348-1049843267-782984527-50788\Control Panel\Desktop on machine u1jbennetterror wasFailed to change key S-1-5-21-1130582348-1049843267-782984527-50788_Classes\Control Panel\Desktop on machine u1jbennetterror wasFailed to change key S-1-5-18\Control Panel\Desktop on machine u1jbennetterror wasError processing machine, u1jbennettError:438Press any key to continue . . .