Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Execute on shutdown

10 Sep 2011   #1
MPREv

Windows 7
 
 
Execute on shutdown

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.

Im looking for this feature for Windows 7 and XP.
Each would help a lot.

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


My System SpecsSystem Spec
.

12 Sep 2011   #2
JaidynM

Windows 7 Ultimate x64/Windows 8 Consumer Preview x64/Ubuntu 11.04
 
 

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.
Task Scheduler - Create New Task
My System SpecsSystem Spec
12 Sep 2011   #3
MPREv

Windows 7
 
 

Quote   Quote: Originally Posted by JaidynM View Post
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.

Quote   Quote: Originally Posted by JaidynM View Post
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

Quote   Quote: Originally Posted by JaidynM View Post
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.
Task Scheduler - Create New Task
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 System SpecsSystem Spec
.


13 Sep 2011   #4
MilesAhead

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
13 Sep 2011   #5
MPREv

Windows 7
 
 

Quote   Quote: Originally Posted by MilesAhead View Post
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:
Quote:
Updateing step 0 of 3
XY% done
Please Do not power off the Computer
Quote   Quote: Originally Posted by MilesAhead View Post
Here's details of how programs are notified of shutdown:
WM_QUERYENDSESSION Message (Windows)
Hmmm ... I'll take a look at that.

Quote   Quote: Originally Posted by MilesAhead View Post
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.

Quote   Quote: Originally Posted by MilesAhead View Post
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 System SpecsSystem Spec
13 Sep 2011   #6
MilesAhead

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
14 Sep 2011   #7
MPREv

Windows 7
 
 

Quote   Quote: Originally Posted by MilesAhead View Post
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.

Quote   Quote: Originally Posted by MilesAhead View Post
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.

Quote   Quote: Originally Posted by MilesAhead View Post
But they call 'em PCs because people do what they want with 'em. Good luck.
I do not understand what is the meaning ...
My System SpecsSystem Spec
15 Sep 2011   #8
JaidynM

Windows 7 Ultimate x64/Windows 8 Consumer Preview x64/Ubuntu 11.04
 
 

Quote   Quote: Originally Posted by MPREv View Post
Quote   Quote: Originally Posted by JaidynM View Post
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.

Quote   Quote: Originally Posted by JaidynM View Post
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

Quote   Quote: Originally Posted by JaidynM View Post
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.
Task Scheduler - Create New Task
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 System SpecsSystem Spec
15 Sep 2011   #9
MPREv

Windows 7
 
 

Quote   Quote: Originally Posted by JaidynM View Post
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 System SpecsSystem Spec
Reply

 Execute on shutdown




Thread Tools





Similar help and support threads
Thread Forum
Execute Last Command
scenario : 1. lmb to select a file or folder. 2. rmb to display context menu and choose 'rename'. 3. type new name. 4. lmb to select another file or folder 5. ... is there a way to program a key or a mouse button to automatically execute step 2 above? Or perhaps it's already one of my...
General Discussion
Windows 7 administrator: can't restart, shutdown, execute anything
Hi all, I have Windows Seven Ultimate running on a machine just fine for about half a year. After installing some piece of software related to android rooting, I found myself unable to do anything on the computer, as launch windows explorer, restart shutdown, start any other program, as this...
General Discussion
Is there a way to execute a prgm/script at user logoff/shutdown?
In old WinXP there was a tricky feature in Group Policy editor to execute a script when a User logs off resp. the computer was shutdown. I do not find this feature in Windos 7 (pro). is there another way to execute a *.bat batch script at a) user logoff b) shutdown? Peter
General Discussion
Help bat file to execute a bat
Hi everyone hope everyone in good health and have a good year. I need help please to make a bat file which works like a emulator or frintend to execute othe bat files. I've searched everywhere but cannot find a tutorial. Can some one please kind enough to help me. I understand it's not related to...
General Discussion
Cannot execute webcam
I have a HP dv9000 with a intagrated webcam 1.3MP. In device manager under imaging devices i shows a HP Pavilion Webcam. In devices and printers it shows a USB Composite Device. Also under all programs or the start menu the is no way to execute the webcam (turn it on so to speak). I surely hope...
Hardware & Devices

Our Sites

Site Links

About Us

Find 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 14:27.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App