When I shut down my Windows XP Pro, SP3 machine – or worse, when my UPS
shuts the computer down after a power outage, I sometimes get the message that
Windows is closing a program. If it doesn’t close the program, the progress bar
stops at the end and it waits for me to do something. Now, I may have left the
room or the UPS may need to shut down in my absence. How can I get it to shut
down, regardless of whether the program successfully closed, without my
intervention?
In this excerpt from
Answercast #92 I look at the difficulties involved in shutting down Windows
if certain programs are opened, and perhaps unsaved, and won’t let the
shut-down process complete.
]]>
Programs cause Windows to wait on exit
Unfortunately, there really isn’t a good answer to this. If you’re doing it manually, in other words if you are shutting down your computer yourself, then you should take care to shut down the applications that you’re running first.
Shut applications first
You shouldn’t have to – but it’s really, really good practice to shut down each of the individual applications (or the applications that you might find would cause something like this) before you actually shut down your computer.
Most of the time, if there’s nothing going on, it will just work when you shut down your computer.
But the scenario that typically crops up is: if you are in a document that is being edited (in other words, if you’ve got something like Word, or a text edit, or maybe even an email compose window open, and you’ve got this document that hasn’t been saved to disk) the program doesn’t know what to do:
-
If it just closes, you’ll lose all of your unsaved work.
-
If it just saves, it may overwrite something you didn’t intend to overwrite.
-
If it saves to some other file name (that perhaps it makes up) then you may not be able to find what it saves.
So it really does need your intervention in order to shut down properly.
That’s why I say the best thing, the safest thing, to do when you’re shutting down your machine yourself, is to close those (I’ll call them…) “major applications” – the applications that are usually editing documents, or have other issues that might legitimately cause them to have to stop on the way out. Close those down manually, first, and then shut down your computer.
Accidental power-down
As for the UPS scenario, I really don’t have a good answer for you.
Not all applications have the ability to respond to this kind of a power-out notification. So Windows really is doing the best that it can.
The only thing that I can… at least, I suppose, give you some hope with – is to know that if programs (like Word, for example) are shut down without having been shut down properly (in other words, if the power’s just removed) then they typically will come back recovering what was in progress from their temporary or backup files.
But that’s Word; it’s not everything you might possibly be using.
So I really don’t have a good answer for the UPS scenario. It is one of those things where it is safest not to walk away from your computer when you have documents in an open and editing state – so that this kind of stuff doesn’t happen.
Sadly, all of the solutions that I’ve just given you boil down to: Avoid this problem by not letting it happen in the first place.
(Transcript lightly edited for readability.)
Next from Answercast 92- Why does Macrium ask for a Username and Password to schedule a backup?
You can change the power settings to force the operating system to hibernate instead of shutting down. Check the UPS software; or make changes from within Windows power options.
To build on Mack’s comments, check the documentation and or software that came with the UPS. It might have the ability to shut down the computer in the event of a power failure.
Erm… you didn’t answer the question !
I have a little “ShutDown” batch file that I use. After doing other things (e.g. back-ups), it finishes with:-
——-[ ShutDown.bat ]——–
REM These commands shut down the computer – depends on version and set-up.
rem C:\WINDOWS\RUNDLL32.EXE user.exe,exitwindows
REM or try:-
rem C:\WINDOWS\rundll32.exe shell32.dll,SHExitWindowsEx 9
REM Or this:-
rem Start Shutdown
REM or this:-
C:\WINDOWS\System32\Shutdown -s -f -t 0
————[ End ]———————-
It’s the last command that currently works on my Win7 computer.
However, your OP wants this to run when he is not there. I don’t know what his system is, but perhaps his UPS calls some shutting down routine, and he could change it for this one ?