how to cleanly shut down your computer when it normally won't
If your computer won't shut down normally, I suggest you force a shutdown rather than turning the computer off.
to force a shutdown of your Windows computer, click Start, Run and type in shutdown -f -s and hit Enter or click OK.
-r: reboot computer. if you have unsigned drivers installed on your machine and it is preventing you from shutting down or restarting normally, try adding -f.
-f: force computer to close open applications without warning (any unsaved changes will be lost)
-s: shutdown computer. on multiuser machines it may just cause a logoff only all by itself. but when used with -f, it will force a shutdown of the machine. this means the disk cache will be written to disk (VERY important for your filesystem and registry).
make sure that you save your files and close your programs before doing this!
this is also handy when a program has hung and can't be killed by task manager's end-task.
you really don't have to use my hibernate program (though mine is easier to use than windows' shutdown.exe program). here is the basics of windows' shutdown program:
shutdown -f -r
shutdown -f -s
abort shutdown or reboot,
the disk cache
The Disk Cache is an important issue. when you save anything to disk, it is actually written to memory as a go-between (the disk cache). Periodically, this disk cache gets written to disk.
BUT if the computer is powered off before the OS has had a chance to write the disk cache to disk, those changes are lost.
that means registry changes, disk writes, and the like. simply powering off the computer loses this kind of important information.
this is why it's important to do a software shutdown if at all possible.
I am working on some software to force a restart called "hibernate" which is on my web site, I am trying different methods (there are 2 available).
my computer won't restart due to some bad drivers from a new model of printer.
then I installed another printer driver for a different replacement printer from a different manufacturer (old printer) and it hung during installation and I had to kill the installer.
I am cleaning it up - files, registry, and all. But I am not sure I can do a complete job. people who write installers like to store their drivers in
c:\windows\system32 (naughty, naughty!), mainly because the PATH gets longer than 1024 characters.
my program for shutting machines down is located in the Software section and it's called hibernate.
it forces a shutdown with the exception of logoff and restart. I am still working on restart to get it to do a forced reboot so my machine will be usable. the ExitWindowsEx() win32 system calls doesn't do forced restart!