Just change the shutdown command so that it isn't rebooting.
List all computers, one per line, in a file called RebootPCs.txt in the same
folder as the script. Also, put SHUTDOWN.EXE in there (or mod the path to
the .EXE) and schedule to run each night with an account that has shutdown
permissions on all the PCs.
Run with CSCRIPT.
' **************************************************************
' RebootPCs.vbs
'
' read computer names from text file and reboot each computer
' sequentially using SHUTDOWN.
'
' paul williams, msresource.net, june 2004
'
' **************************************************************
Option explicit
const FOR_READING = 1
const FILE_NAME="RebootPCs.txt"
dim objOperatingSystem,objWshShell,objFso,objFileIn,objWmi
dim colOperatingSystems,arr()
dim strHost,str
dim i,oExec
i=0
set objWshShell=wscript.createObject("WScript.Shell")
set objFso=createObject("Scripting.FileSystemObject")
set objFileIn=objFso.openTextFile(FILE_NAME,FOR_READING)
if(err.number<>0)then err.clear : echo"File does not exist." :
wscript.quit(-1)
readHosts
rebootHosts
' ***********************************************
' readHosts()
'
'
' ***********************************************
Private Sub readHosts()
do while objFileIn.atEndOfLine<>true
reDim preserve arr(i)
str=objFileIn.readLine
arr(i)=str
i=i+1
loop
End Sub
' ***********************************************
' rebootHosts()
'
'
' ***********************************************
Private Sub rebootHosts()
for each strHost in arr
objWshShell.run "shutdown \\" & strHost & " -r -f -t 180"
next
End Sub
' ***********************************************
' echo(string messageToEcho)
'
' Sub routine simply echos the passed string.
' Sub used for outputting all information to the screen/ console
'
' ***********************************************
Private Sub echo(strMessage)
wscript.echo strMessage
End Sub
--
Paul Williams
Microsoft MVP - Windows Server - Directory Services
http://www.msresource.net | http://forums.msresource.net
"Just Guessing" <JustGu...@discussions.microsoft.com> wrote in message
news:B111E72C-FDFA-4E71...@microsoft.com...