Windows 7 Forums Search
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows 7. The Windows 7 forum also covers news and updates and has an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7 - Don't want shutdown script to run on restart

 
05-23-2011   #1


Windows 7 Professional 64-bit
 
 

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 System SpecsSystem Spec
05-23-2011   #2


W7 Professional x64
 
 


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 System SpecsSystem Spec
05-24-2011   #3


Windows 7 Professional 64-bit
 
 


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 System SpecsSystem Spec
.


05-24-2011   #4


W7 Professional x64
 
 


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 System SpecsSystem Spec
Reply

 Don't want shutdown script to run on restart problems?



Thread Tools



Similar Threads for: Don't want shutdown script to run on restart
Thread Forum
Script to restart an application if it has stopped. General Discussion
VBS script that shutdown other pc in network. Network & Sharing
Restart time script problem Performance & Maintenance
Easy way to run script at shutdown without gpedit? General Discussion


All times are GMT -5. The time now is 11:38 PM.



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
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30