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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top