BM-productions SmartClose is a <img src=/S/free.gif border=0 alt=free width=30 height=15> program (629 KB) that will automate the process of closing all running programs. It can also save the state of the system to a system snapshot, so all the programs that have been closed can be easily restarted later by SmartClose."

Especially nice features (IMHO) include the ability to exclude certain processes from closure (AV, firewall as well as user-selected processes) and a rich set of commandline options. I am using the latter in a "backup then shut down" batch file, to close "file locking" processes, prior to a full backup. This way, no files and excluded from backup.