I frequently leave the computer on playing a movie or downloading a file while I go to bed. I do use the 'shutdown computer when finished' feature of KMPlayer or getright or uTorrent or whatever program I am using. This method effectively shuts down the computer, but the problem is that there are some applications that seem to exit forcefully when doing this kind of shutdown, this being clearly reflected in winamp not saving the current playlist and config, messenger not saving the chat logs, etc.

My goal here would be to have automatically close properly all applications when the auto/scheduled program triggers it. I am looking for some Windows shutdown mode/setting that does application closing like the user would do.

I am not expecting to auto-click on save dialogs prompts, if this is needed I will do it before leaving the computer on for auto shutdown.

  • 1
    I think it is more of a problem with the program being coded to shut down gracefully when requested to do so by the OS, more than it is a Windows shutdown problem, not sure there is a solution. – Moab Jan 2 '11 at 19:45

Try taskkill.exe /IM, use tasklist.exe to see list of processes.

  • What does the /IM do? – Ivo Flipse Mar 26 '12 at 13:22
  • Image name, in other words, something like notepad.exe – Ruu Apr 2 '12 at 3:11

With NirCmd (copy the file to C:\Windows\System32) you can set the computer to shut down (softly) by running

NirCmd.exe initshutdown <timeinseconds> 

or if your program supports running a command when it's done,

NirCmd.exe initshutdown
  • That does not solve the OP's problem. Besides, there's already a command for that (>shutdown -s -t <timeinseconds>), no need for a third party app. – Gani Simsek Jan 2 '11 at 20:45
  • It should, if the app works as described in the documentation, shut down the computer nonforcefully (if that's word). – digitxp Jan 2 '11 at 20:48
  • Thanks for suggestion, nircmd seems like a nice utility but I doubt this would be any different from timed shutdown – vashman Jan 4 '11 at 3:13

As rightly said by Moab in a comment :

I think it is more of a problem with the program being coded to shut down gracefully when requested to do so by the OS, more than it is a Windows shutdown problem, not sure there is a solution.

You would need to raise this issue with the Support of winamp and messenger or any other application this happens with. There is no general solution.

  • I was hoping there could be different shutdown signals for the OS to send to applications and maybe my windows installation was configured to send a 'inmediate termination' signal or something that could be changed to a 'shutdown please' signal.. – vashman Jan 3 '11 at 17:43
  • This is already the way shutdown is done in Windows. Forced termination only happens if the program ignores the polite message and for a certain time. – harrymc Jan 3 '11 at 19:17
  • I understand what you are saying, the thing is we are talking about what I would consider mature applications (nullsoft winamp, windows live messenger) that should be able to handle shutdown signals properly. Also I was not expecting to address this issue separately for each application... – vashman Jan 4 '11 at 3:20
  • This might be a problem of a misbehaved plugin, as suggested for example in this thread. – harrymc Jan 4 '11 at 6:47
  • Thanks for pointing out that issue. However I don't think I am using any special plugin for winamp, just the ones that come with the default installation. – vashman Jan 5 '11 at 19:17

You can try to play with the following values in the registry:

HKEY_CURRENT_USER\Control Panel\Desktop\WaitToKillAppTimeout HKEY_USERS.DEFAULT\Control Panel\Desktop\WaitToKillAppTimeout HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\WaitToKillServiceTimeout

Try increasing the values to allow more time for applications to shut down correctly. But as several users have already noted correctly - often the problem is within the Application, not within Windows shutdown sequence.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.