Is there a windows app or simple scripting way to persuade windows to shutdown after a process ends?

Can anyone suggest a way of asking Windows to shut down after it has finished doing something? For example it would be handy sometimes if burning a DVD or copying a lot of files to be able to set it off at the end of the day and just say "hey Windows, when you've finished doing this, shut down."

At the moment the best alternative I've found is to use a commandline shutdown and guess at a time but particularly with things like file operations windows can make it a trifle difficult to predict how long they will take so you have to be very conservative in your guesswork and probably leave the computer running for much longer than necessary in most cases or risk the job not being finished.


Poweroff can schedule a shutdown when an application finishes.


The two solutions I can think of are to either find an alternate application that supports shutdown after it finishes. (CDBurnerXP supports it - Available on Ninite), or launch your application from a script.

For example, you can copy and paste this to notepad:

NOTEPAD

SHUTDOWN /S

Save this as anything you want with a .BAT or .CMD extension then simply launch it whenever you want.

This should launch notepad, then when you close, give a 30 second count down (You can open a new command prompt window and type SHUTDOWN /A to abort).

You can adapt this to do what you want.