Windows 7 How to detect a shutdown or reboot?

  • Thread starter Thread starter Simon Weel
  • Start date Start date
S

Simon Weel

Guest
The domain logoff script (plain Windows CMD script) starts a program to create an image of the local system. That image is stored on one of the servers and can be used to restore a Windows machine if it goes on the blink. The script looks for a file that's created once a month by Task Scheduler. If found, it starts the Image program. Creating an image takes a while.

Now if someone reboots it's machine on the day the image creation is scheduled, it's faced with a machine creating the image and he / she has to wait for it to finish. I don't want that, so I'm looking for a way to detect if Windows is either shutdown (run the image program) or rebooted (don't run the image program). I found a Powershell script (huge) that determines a reboot / shutdown but Powershell isn't my thing. So I wonder if there's an easier way to detect a reboot / shutdown?

Simon


Simon Weel

More...
 
Back
Top