Do you have programs open and expect windows to close them for you? If so this is bad practice and may be your problem.

Have you cleaned your PC from virus and spyware?
This is the main solution to all shutdown issues.

I won't provide links, just search for
AVG antivirus
EWIDO
Spybot search and destroy
Adaware SE
winsockfix (fixes damaged sockets do to spyware)
hijackthis (use at your discretion) must know what you are doing)

After no virus and no spyware can you attack a problem.