Execute on shutdown

MPREv

New member
Member
VIP
Local time
11:19 PM
Messages
136
Hallo,

For some reasons I want to execute some programs before the System is shut down.

I want to normally choose the shutdown button to perform the shutdown
(or other button on the same location),
But a message should show something like “performing …”
and after finishing finally shutting down the PC.
The Windows Update sometimes does have the same behaviour.

I’m looking for this feature for Windows 7 and XP.
Each would help a lot.

I also already tried some programs, but it looks like I’m not geek enough ;)
I hope someone already achieved this and could explain how.
 

My Computer

OS
Windows 7
Windows 7 Shutdown Assistant looks good but it's $19.95. There's a free trial though if you want to check it out.
Windows 7 Shutdown Assistant – Help You schedule Windows 7 PC to shut down, Write Notes and Run file, Program

You could also run the command where **** is the time in seconds until shutdown:
shutdown -s -t ****

Another option is to use the native Task Scheduler. This will enable you to automatically run a program at a certain time. You might be able to shutdown the system after the program has finished.
http://www.sevenforums.com/tutorials/12444-task-scheduler-create-new-task.html
 

My Computer

Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64/Windows 8 Consumer Preview x64/Ubuntu 11.04
CPU
Intel Pentium Dual Core E6700 3.2GHz
Motherboard
ASUS P5G41T-M LX
Memory
Strontium 8192MB DDR3 1333Mhz
Graphics Card(s)
msi GeForce N560GTX-M2D1GD5 1GB
Sound Card
Realtek HD Audio
Monitor(s) Displays
CHIMEI CMV 221D 22"
Screen Resolution
1680x1050
Hard Drives
Seagate Barracuda LP Green 3.5'' 2TB Internal HDD 5900RPM + WD Elements Desktop 1TB External HDD 7200RPM
PSU
SHAW Viper-1500w Gaming PSU
Case
Black eMaxx ATX Mini Tower Case
Keyboard
Microsoft Wireless Keyboard 1000
Mouse
Microsoft Wireless Optical Mouse 2000
Internet Speed
100GB @ 4.76Mbps
Windows 7 Shutdown Assistant looks good but it's $19.95. There's a free trial though if you want to check it out.
Windows 7 Shutdown Assistant – Help You schedule Windows 7 PC to shut down, Write Notes and Run file, Program
I do not realy know what this Programm realy does.
But It does not put A button to the shut down option where I can select the spectial shutdown.
It can also not replace the normal shut down, with aditional pre shutdown features.

You could also run the command where **** is the time in seconds until shutdown:
shutdown -s -t ****
running a Programm that shuts down the PC in the end is not the same,
also it is uncomfortable and the usere can interfer with it and cause Problems

Another option is to use the native Task Scheduler. This will enable you to automatically run a program at a certain time. You might be able to shutdown the system after the program has finished.
http://www.sevenforums.com/tutorials/12444-task-scheduler-create-new-task.html
The Task scheduler also does not provide a Feature to trigger a programm during shutdown.

My Goal would be a changed shut down.
So that a Programm/script can run like the windows update during the shutdown process. So that the user can not get in trubels working on the machine.
Th script than could be used eg for BackUp purpose, ....

The feature is that the user is not disturbed as it does not run when he is working on the PC but when he is leaving the PC.
Also the user don't have to think about it!
A seperate programm placed anywere else would not archive the same.


So what I'm now thinking about is: What does the Windows Shutdown button triger?
Is there a way to change this command to another script/program which would show a shutdown screen and process its work.
 

My Computer

OS
Windows 7
It's not really a good idea to try to perform lengthy tasks at shutdown. For one thing, apps that don't reply TRUE meaning it's ok to shut down, are displayed on the shutdown screen(that black screen saying "waiting for a background process to end") and the user can kill them, thinking they are hung.

Here's details of how programs are notified of shutdown:
WM_QUERYENDSESSION Message (Windows)

If you have to do some task, then restart the computer, it's better to use a program that specifically does it. There are system calls to restart the computer and restart certain apps on startup etc.. See the MSDN section on shutting down.

Another risk is some users seeing it take forever to shut the system down may just hold down the power button.
 

My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
It's not really a good idea to try to perform lengthy tasks at shutdown. For one thing, apps that don't reply TRUE meaning it's ok to shut down, are displayed on the shutdown screen(that black screen saying "waiting for a background process to end") and the user can kill them, thinking they are hung.
Windows Update does NOT show this screen.
It shows somethink like:
Updateing step 0 of 3
XY% done
Please Do not power off the Computer

Here's details of how programs are notified of shutdown:
WM_QUERYENDSESSION Message (Windows)
Hmmm ... I'll take a look at that.

If you have to do some task, then restart the computer, it's better to use a program that specifically does it. There are system calls to restart the computer and restart certain apps on startup etc.. See the MSDN section on shutting down.
Why Restart?
The system should perform the task, shutdown and stay off.
Windows Update also uses this procedure for many tasks.

Another risk is some users seeing it take forever to shut the system down may just hold down the power button.
They will not if they see the massage.
And if so, they will also do it, in other cases, so this is not the problem.
 

My Computer

OS
Windows 7
I didn't say Windows Update shows a screen. I said the shutdown shows the screen if apps are busy and refusing to shut down. It's not a good place to do lengthy stuff. But they call 'em PCs because people do what they want with 'em. Good luck.
 

My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
I didn't say Windows Update shows a screen. I said the shutdown shows the screen if apps are busy and refusing to shut down.

I didn't say that you said ;)
But fact is that Windows update shows a screen if it is nessesary and there you can NOT stop it.

It's not a good place to do lengthy stuff.
I think it is the perfect place!
During using, the PC does have to do other things I want to do.
At start up I don't want to wait till the PC is ready.
On shut down ... click - good bye - PC is working and I'm doing some other stuff.

But they call 'em PCs because people do what they want with 'em. Good luck.
I do not understand what is the meaning ...
 

My Computer

OS
Windows 7
Windows 7 Shutdown Assistant looks good but it's $19.95. There's a free trial though if you want to check it out.
Windows 7 Shutdown Assistant – Help You schedule Windows 7 PC to shut down, Write Notes and Run file, Program
I do not realy know what this Programm realy does.
But It does not put A button to the shut down option where I can select the spectial shutdown.
It can also not replace the normal shut down, with aditional pre shutdown features.

You could also run the command where **** is the time in seconds until shutdown:
shutdown -s -t ****
running a Programm that shuts down the PC in the end is not the same,
also it is uncomfortable and the usere can interfer with it and cause Problems

Another option is to use the native Task Scheduler. This will enable you to automatically run a program at a certain time. You might be able to shutdown the system after the program has finished.
http://www.sevenforums.com/tutorials/12444-task-scheduler-create-new-task.html
The Task scheduler also does not provide a Feature to trigger a programm during shutdown.

My Goal would be a changed shut down.
So that a Programm/script can run like the windows update during the shutdown process. So that the user can not get in trubels working on the machine.
Th script than could be used eg for BackUp purpose, ....

The feature is that the user is not disturbed as it does not run when he is working on the PC but when he is leaving the PC.
Also the user don't have to think about it!
A seperate programm placed anywere else would not archive the same.


So what I'm now thinking about is: What does the Windows Shutdown button triger?
Is there a way to change this command to another script/program which would show a shutdown screen and process its work.

Sorry, I couldn't find much else. If I come across any such program, I'll be sure to VM/PM you.
 

My Computer

Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64/Windows 8 Consumer Preview x64/Ubuntu 11.04
CPU
Intel Pentium Dual Core E6700 3.2GHz
Motherboard
ASUS P5G41T-M LX
Memory
Strontium 8192MB DDR3 1333Mhz
Graphics Card(s)
msi GeForce N560GTX-M2D1GD5 1GB
Sound Card
Realtek HD Audio
Monitor(s) Displays
CHIMEI CMV 221D 22"
Screen Resolution
1680x1050
Hard Drives
Seagate Barracuda LP Green 3.5'' 2TB Internal HDD 5900RPM + WD Elements Desktop 1TB External HDD 7200RPM
PSU
SHAW Viper-1500w Gaming PSU
Case
Black eMaxx ATX Mini Tower Case
Keyboard
Microsoft Wireless Keyboard 1000
Mouse
Microsoft Wireless Optical Mouse 2000
Internet Speed
100GB @ 4.76Mbps
Sorry, I couldn't find much else. If I come across any such program, I'll be sure to VM/PM you.
Thanx, thats very nice!

I'm now thinking at a new approache.

The Windows Taskplaner.
There you can choose a event as trigger.
I look in the predefined but I don't find a "start to shut down" like event.

But if there is one this could be used I think!

Maybe anyone else know something ...
 

My Computer

OS
Windows 7
Back
Top