Hardware

Why Does My Computer Keep Restarting Randomly? Causes and Fixes

If you are asking why your computer keeps restarting randomly, the cause is a crash, a power fault or heat. Open Event Viewer, find Kernel-Power event 41 and read its details to see which one, then fix that cause.

The steps below assume Windows, where Event Viewer records unexpected restarts. The hardware causes apply to any desktop or laptop. If your machine powers off and stays off instead of restarting, see why a computer keeps shutting down.

Step 1: Tell a crash from a power loss

Microsoft describes Kernel-Power event 41 as generated when "the computer is shut down or restarts unexpectedly". When Windows starts, it checks whether the last shutdown was normal. If it was not, event 41 is written to the System log with the message "The system has rebooted without cleanly shutting down first."

To read it, press Windows+R, type eventvwr.msc and press Enter. Open Windows Logs > System, choose Filter Current Log and enter 41 as the event ID. Or run this in PowerShell:

Get-WinEvent -FilterHashtable @{ LogName = 'System'; Id = 41 } -MaxEvents 5 | Format-List TimeCreated, Message

Open the event and read the Details tab. Microsoft lists three known situations:

  • A stop error occurred and the computer restarted. The stop error data is in the event, so the bugcheck value is not zero. This is a crash.
  • The power button was held for four seconds. The PowerButtonTimestamp value is non-zero. Something forced the power off.
  • Neither value was recorded. Microsoft notes that the stop error data or power button data are sometimes not recorded even when they were the cause, and then both are 0. A sudden power cut or a thermal reset fits here.

Microsoft also warns that there "might not be enough information to determine what caused the event", so use the event time and what you were doing just before it. Note that this Microsoft page is archived documentation written for Windows 7 and Windows Server 2008 R2. The event still appears on current Windows versions, but check the details on your own machine.

What event 41 showsWhat it points to
Non-zero bugcheck codeWindows crashed: driver, memory, disk or overclock instability
Non-zero PowerButtonTimestampThe power button was held down
All zeros, restart under loadPower supply, overheating or a loose power connection
All zeros, restart at idlePower connection, a failing component, or a forced update restart

This table is a starting point for troubleshooting, not a diagnosis. Several faults look alike.

Step 2: If it was a crash, find the stop code

Windows can be set to restart automatically after a crash. That is why you may never see the blue screen: it appears for a moment and the machine reboots. Turn the automatic restart off so the next crash stays on screen:

  1. Type Advanced system settings in the taskbar search box and press Enter.
  2. On the Advanced tab, under Startup and Recovery, select Settings.
  3. Under System failure, clear Automatically restart and select OK.

Windows also saves memory dumps when it crashes. Microsoft's documentation gives the locations: a small memory dump (256 KB) goes to %SystemRoot%\Minidump, and kernel, complete and automatic dumps go to %SystemRoot%\MEMORY.DMP. To see whether any minidumps exist and when they were written:

Get-ChildItem C:\Windows\Minidump | Sort-Object LastWriteTime -Descending | Select-Object Name, LastWriteTime, Length

If the folder is empty or missing, Windows either did not crash or is not set to write small dumps. Microsoft's steps for changing that are under Write debugging information in the same Startup and Recovery window; its guide suggests Automatic memory dump, then a restart for the setting to apply.

The stop code on the screen, or in the dump, names the fault area. The blue screen of death guide covers how to read it and the order to try fixes in.

What usually causes the crash

Microsoft's analysis of the root causes of stop errors gives these proportions:

  • 70% are caused by third-party driver code.
  • 10% are caused by hardware issues.
  • 5% are caused by Microsoft code.
  • 15% have unknown causes, because the memory is too corrupted to analyze.

That ordering tells you where to start. Think back to what changed before the restarts began: a new graphics, network or storage driver, a Windows update, new hardware, or a utility that installs its own driver. Microsoft's general steps for stop errors are:

  1. Install the latest Windows updates.
  2. Make sure the BIOS and firmware are up to date.
  3. Run hardware and memory tests.
  4. Scan for malware.
  5. Keep enough free disk space. Microsoft recommends 10 to 15 percent.
  6. If a specific driver is named, or you made a recent software or hardware change, get an updated driver from the vendor, or roll the change back.

For memory, run the Windows Memory Diagnostic. If you have turned on an XMP profile or overclocked the CPU or RAM, go back to default settings for a day. An unstable overclock is a common cause of restarts that look random, and removing it is the quickest test.

Step 3: If event 41 shows zeros, check power and heat

A restart with no recorded crash means the system lost power or reset faster than Windows could write anything. Work through these in order, cheapest first.

  • Desktop: power cable and outlet. Reseat the cord at both ends and test the outlet with another device. Take the PC off a power strip or surge protector for a test.
  • Desktop: internal connectors. With the PC unplugged, reseat the 24-pin motherboard cable, the CPU power cable and any graphics card power cables.
  • Desktop: power supply capacity. A PC that is fine at idle and restarts during a game or render is the classic sign of an undersized or worn supply. The only reliable test is swapping in a known good unit. Do not open a supply: its capacitors can hold a dangerous charge after unplugging.
  • Laptop: battery and charger. Test with the battery removed if it is removable, or with a different charger of the same rating. If it restarts on battery only, the battery is suspect.
  • Heat. Watch temperatures while you reproduce the restart, using how to check CPU and GPU temperature. If the numbers climb steadily and the machine resets, clean the dust from fans and vents, confirm every fan spins, and give a laptop room to breathe on a hard surface.

Step 4: Rule out software triggers

Some restarts are intended, even if they surprise you.

  • Windows Update. Updates can restart the computer after installing. Check Settings > Windows Update and its update history for the time of the restart.
  • Scheduled tasks. Press Windows+R, run taskschd.msc and look for any task that runs shutdown.exe or restarts the machine.
  • Peripherals. Unplug USB devices and extra drives. A faulty device can cause a reset or a driver crash.
  • Malware. Microsoft lists a virus scan among its general stop error steps. A full Windows Security scan costs nothing.

If it still restarts

Strip the machine down: one memory stick, no extra drives, no add-in cards, and the monitor on integrated graphics if the CPU has it. If it stays up, add parts back one at a time until the restarts return. Microsoft says of hardware faults that they "may cause erratic and unpredictable behavior that can manifest itself in various symptoms", and that isolating components and then trying to trigger the error again is how you find the cause. If it restarts even when stripped down, the power supply, motherboard or CPU cooler is the likely culprit. A swap test with a known good power supply is the cheapest next step, followed by the manufacturer's warranty or a repair shop.

Frequently asked questions

Why does my computer restart by itself without a blue screen?
Either Windows crashed and was set to restart automatically before you could read the error screen, or the machine lost power or hit a thermal limit and rebooted with no crash recorded. Event Viewer separates the two: a crash leaves a non-zero stop error value in Kernel-Power event 41, while a power loss usually leaves zeros.
Can a driver make a computer restart randomly?
Yes. Microsoft's analysis of the root causes of Windows crashes attributes 70% to third-party driver code, 10% to hardware issues, 5% to Microsoft code and 15% to unknown causes. If the restarts began after a driver or Windows update, rolling back or updating that driver is the first thing to try.
Can a failing power supply cause random restarts?
It can. A supply that cannot hold its voltage under load can reset the whole system instantly. Windows gets no time to record a crash, so event 41 shows zero values. The reliable test is swapping in a known good supply.
How do I stop Windows restarting automatically after a crash?
Open System Properties, go to the Advanced tab, choose Settings under Startup and Recovery, and clear Automatically restart under System failure. The next crash then stays on screen so you can read the stop code.

Sources