Batch File for timed shutdown

  • Thread starter Thread starter Adrian
  • Start date Start date
A

Adrian

Can anyone help.

Is there a batch file or a commanf that will shut XP professional down at a
given time that you can specify. I ask because I do long downloads into the
night and I wnat the ability to shut down automatically

Thanks
 
Use the following WMI Script. Copy and paste all 5 lines into a Notepad
file and save it with a VBS extension:

WMIQuery = "select * from Win32_OperatingSystem where Primary=true"
Set OpSysSet =
GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery(WMIQuery)

for each OpSys in OpSysSet
OpSys.Shutdown()
next


Note: the second line goes from Set OpSysSet to (WMIQuery), in case it
wraps. Then create a scheduled task to run the script.
 
Back
Top