Shutdown Script

  • Thread starter Thread starter PC
  • Start date Start date
P

PC

I know this is probably a basic question, so please forgive me. I want to
shut my XP Pro machine down at 11pm BUT leave my UPS on. Does anyone know
of a script that can shut the machine down at a specific time?

PC
 
PC, Fri, 5 Sep 2003 09:23:57 -0000:
I know this is probably a basic question, so please forgive me. I want to
shut my XP Pro machine down at 11pm BUT leave my UPS on. Does anyone know
of a script that can shut the machine down at a specific time?

PC

Use sheduled tasks in Control Panel to run windows\system32\shutdown.exe at
that time. In the properties of the task add -s to the end of the command,
e.g. C:\WINDOWS\system32\shutdown.exe -s, which will cause a shutdown.

You can further customise this by adding a message to display when shutting
down and setting the time given before shutdown (to allow work to be saved
etc). Type "shutdown" at a command prompt for details.
 
Copy and paste the following into a Notepad file and save it with a VBS
extension. Then create a Shceduled Task that points to the VBS file you
created.

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

There are 5 lines in the above code, so make sure nothing wraps.
 
Another way is to get a macro-making program. A true
freeware one is at

http://www.webattack.com/get/macromaker.shtml

and it works pretty well. Note that it has caused me a
few minor problems for non-power userers on the same
machine in XP, but there is probably a simple fix to it
that I have just not sought yet.

There are other priceware macro-making programs you can
search the Net for. All of them I have tested (free and
price) have a very quick feature to make a macro to cause
shutdown with hotkeys you assign.

Of course, learning to use macros for your repetitive is
just good computing in general.
 
Just to give yet another option here.

You can go to www.grc.com and download the free (and ad
and spy free) wizmo.exe, configure an event in it for
shut down it gives clear directions how to), then make a
scheduled task to point to the event. Wizmo is pretty
cool for a few other things, too.
 
Back
Top