Don't want shutdown script to run on restart

daropez

New member
Local time
3:50 AM
Messages
2
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 My Computer

At a glance

Windows 7 Professional 64-bit
OS
Windows 7 Professional 64-bit
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 My Computer

At a glance

W7 Professional x64Core 2 Duo 2.932 GBATI Radeon 4695
Computer Manufacturer/Model Number
HP 6000 Pro Micro Tower
OS
W7 Professional x64
CPU
Core 2 Duo 2.93
Memory
2 GB
Graphics Card(s)
ATI Radeon 4695
Monitor(s) Displays
Two HP 17's
Hard Drives
150GB Sata Drive
Case
Tiny. Kinda cute.
Keyboard
HP Supplied. Surprisingly nice.
Mouse
Gateway Mouse from an E2610D
Internet Speed
45 mbps
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 My Computer

At a glance

Windows 7 Professional 64-bit
OS
Windows 7 Professional 64-bit
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 My Computer

At a glance

W7 Professional x64Core 2 Duo 2.932 GBATI Radeon 4695
Computer Manufacturer/Model Number
HP 6000 Pro Micro Tower
OS
W7 Professional x64
CPU
Core 2 Duo 2.93
Memory
2 GB
Graphics Card(s)
ATI Radeon 4695
Monitor(s) Displays
Two HP 17's
Hard Drives
150GB Sata Drive
Case
Tiny. Kinda cute.
Keyboard
HP Supplied. Surprisingly nice.
Mouse
Gateway Mouse from an E2610D
Internet Speed
45 mbps
Back
Top