I use PageDefrag to keep my page-file healthy, and have it set to run at every boot with a 1sec timeout. I think it would be really handy to be able to defrag the rest of my machine every-time I tell my machine to shut-down (not restart). If it could activate after windows has killed all the background processes and provide a little information on it's progress it would be very useful.
Is there anything that can do this, or is there a way I can "hook" a batch file/command into the shut-down process to run "defrag.exe"?
Please Note: I'm not looking for something that can defrag then shutdown, but rather initiate the shutdown procedure (to close all running/background apps) and then pause the shutdown to run the defrag while there are no locked files.