Two important things that you should do to fix a laptop which keeps shutting down are:
1- Scanning computer to eliminate malwares, spywares and the viruses from your laptop.
2- Repairing and cleaning Windows registry.
These two tips are found to be very helpful to fix the laptop shutdown problem.
I also got some help from this article Laptop Keeps Shutting Down
Hope it works for you.