I had a similar problem with my laptop running Windows 7. The directions below helped me fix it:
1. Go to Start menu and type in rededit in the search box. Click on regedit. Note: You might have to right click it and choose "Run as administrator"
2. Go to HKEY_LOCAL MACHINE, SYSTEM, CurrentControlSet, Control, Session Manager, Memory Management.
3. Locate ClearPageFileAtShutdown. Double click it and change value to 0. This was set at 1 on my laptop and that's why it took so long to shut down. Close Registry Editor.
4. Try shutting down or restarting your machine and see what happens.