Try running a registry cleaner like CCleaner. Also check to make sure the HDD is not full.
It sounds like it is trying to do a registry action and cannot. This can be caused from hard booting the computer during an update, bad Ram, a failing HDD, or a dying mobo. Also, do a hard reset on the Bios and see if that clears up the problem.
In its attempt to shut down your windows is encountering a conflict that it can't resolve so that's why you end up with the blue screen. I would after shut down unplug the power supply and leave it unplugged for at least 10 min. If you don't have any bios settings that you have set , like overclocking then I would also take out the battery and that would clear the cmos. If you have set ACHI mode make sure you reset it back. You can also run memtest to check the ram. It would have been helpful if you would have listed what is in your computer and especialy what version of Windows you have , you are asking us to work in the dark here.