Don't want shutdown script to run on restart


  1. Posts : 2
    Windows 7 Professional 64-bit
       #1

    Don't want shutdown script to run on restart


    Hi,

    I've got my system configured via gpedit so that it runs a custom batch script when it shuts down. The script can take about a minute to complete because it is telling some external hardware to run through its power down procedure. However when I tell the system to _reboot_ the script still runs and then when the system starts back up it has to run the startup script to power the hardware back up again.

    Therefore I wondered if there is a way to tell Windows not to run the script if the action is reboot, not shutdown, or can I get access to the action via some parameters that can be passed to my script?

    Searched through forums but can't find any answer to this - maybe the search terms are too common.

    Many thanks
      My Computer


  2. Posts : 471
    W7 Professional x64
       #2

    Unless you can somehow specify in the script to only run on shutdown rather than reboot, I don't see a way in Gpedit, since it tailors purely to startup/shutdown function, and doesn't acknowledge reboots.
      My Computer


  3. Posts : 2
    Windows 7 Professional 64-bit
    Thread Starter
       #3

    That's fine, but how can I tell if the current operation is shutdown or restart? Is there a parameter list I can pick up and pass on to the script as command line args?
      My Computer


  4. Posts : 471
    W7 Professional x64
       #4

    That, I'm afraid, is beyond my realm of expertise. I'm not much of one for scripting. I will try and look into the issue though...
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:15.
Find Us