Execute on shutdown


  1. Posts : 136
    Windows 7
       #1

    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.

    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


  2. Posts : 8,398
    Windows 7 Ultimate x64/Windows 8 Consumer Preview x64/Ubuntu 11.04
       #2

    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 Computer


  3. Posts : 136
    Windows 7
    Thread Starter
       #3

    JaidynM said:
    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.

    JaidynM said:
    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

    JaidynM said:
    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 Computer


  4. Posts : 5,092
    Windows 7 32 bit
       #4

    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


  5. Posts : 136
    Windows 7
    Thread Starter
       #5

    MilesAhead said:
    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
    MilesAhead said:
    Here's details of how programs are notified of shutdown:
    WM_QUERYENDSESSION Message (Windows)
    Hmmm ... I'll take a look at that.

    MilesAhead said:
    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.

    MilesAhead said:
    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


  6. Posts : 5,092
    Windows 7 32 bit
       #6

    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


  7. Posts : 136
    Windows 7
    Thread Starter
       #7

    MilesAhead said:
    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.

    MilesAhead said:
    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.

    MilesAhead said:
    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


  8. Posts : 8,398
    Windows 7 Ultimate x64/Windows 8 Consumer Preview x64/Ubuntu 11.04
       #8

    MPREv said:
    JaidynM said:
    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.

    JaidynM said:
    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

    JaidynM said:
    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 Computer


  9. Posts : 136
    Windows 7
    Thread Starter
       #9

    JaidynM said:
    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


 

  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 04:45.
Find Us