The last thing you want to do at 5 o’clock on a Friday afternoon is wait ten minutes for your laptop to shut down so that you can hit the road. Sometimes, a slow shutdown can be even more frustrating than a slow startup.
Luckily, Microsoft has a utility that can help with lethargic shutdowns. The Xbootmgr utility is included as a part of the Windows Performance Toolkit. You can schedule this utility to run with the command:
Xbootmgr.exe –trace shutdown –traceflags latency+dispatcher –numrums 1
The utility will reboot your computer twice (once, plus the number specified by the numruns switch), and when it is done it will generate an XML file detailing the shutdown of each process and the time it took for them to shutdown. Using this information you can determine where your shutdowns are stalling.