When a laptop shuts off by itself, it is potentially caused by one of various issues, which often include an inefficient battery, a computer virus or overheating of the computer itself. It is possible to correct each of these issues without the need to replace or repair major components of the laptop.
Laptop batteries have a limited shelf life and need to be replaced periodically. If the laptop is an older model or gets excessive use on a daily basis, the battery is potentially reaching its useful life span. This is easily determined by removing the battery and powering the laptop with the charger alone. If it runs smoothly without turning off, the battery is the likely culprit. If a computer gets overheated, it has a mechanism that protects the hardware by shutting the entire system off. Users can avoid overheating by placing laptops of a hard surface, particularly if the fan is located on the bottom of the laptop. Fans can also be replaced if they are malfunctioning or have exceeded their useful life. Alternately, free software programs are available online for controlling the speed of a computer's fan. A virus scan should be run on a regular basis to ensure that the system is clean of bugs and malware. These are attacks from a third party that can severely affect a system in negative ways, including causing the laptop to shut down.