I have written a short batch file that can make your time on the computer much more efficient. Here’s the code: copy it into an empty text file, rename the extension .bat, place the file in your autostart folder, and you’re ready to go.
@echo off
%SystemRoot%\system32\shutdown.exe -s -f -t 900 -c “Better get cracking!”
pause
This will give you 15 minutes to get your work done before the computer shuts down. (Or, alternately, 15 minutes to remove the file from your autostart folder.)
Now, to be honest, I don’t use it quite like that. I use the following version (and it’s not in the autostart folder):
@echo off
%SystemRoot%\system32\shutdown.exe -s -f -t 10 -c “Shutting down, no questions asked!”
pause
I do this because, as mentioned a year ago on David July’s blog, I have a program (SAMPLE.EXE) that won’t close properly. It’s related to the Intel PROSet Network adapter, I’m certain, but it’s annoying because I need to wait around at shutdown to tell the computer that yes, SAMPLE.EXE should be terminated. My little batch file takes care of all that (and any other programs that might be running), plus it saves the extra click on “Turn off.” It’s all in the -f parameter.
I think the original idea of shutdown.exe was to be able to shut down another computer on the network remotely, not your own – anyone can shut down his own computer, right? – but it suits my problem perfectly. I’m not sure what it says about me, though, that it took me a year to come up with the simple brute force solution to this problem.
Allow me to credit the http://www.computerhilfen.de forums for batch help.
Oooo — I could use this! I, too, have files that refuse to shut down properly.
I should add that the batch is three lines – the line break in the blog blurs that a bit. The first line is the “@echo off,” the second and third belong together, and the (superfluous) “pause” is the third line of the batch file.
If you’re devious, and you have a network where you know the user names, you can put this file in user A’s autostart folder, and have it shut down user B’s computer. I wonder how long it would take to find that one out…