To begin, open Command Prompt with Admin privileges and enter the following command, then press Enter:
powercfg -lastwake
If you're unsure how to open Command Prompt as an Administrator, refer to the article on running CMD as Administrator on Windows 7, 8, 8.1, 10 on Mytour for guidance.
The above command will display a list of devices that last woke up your computer. Next, enter the following command:
powercfg -devicequery wake_armed
The above command will display a list of all devices capable of waking up your computer. If the cause of continuous computer restarts lies within the hardware realm, the ideal solution is to execute the second command.
In the example list below, you can see three devices capable of waking up the computer, including the keyboard, mouse, and Gigabit network connection, which refers to Ethernet.
Fixing Automatic Computer Restarts
If your Windows computer restarts after being put into Sleep mode or randomly restarts, the culprit causing the error is likely hardware or software malfunctions. The following section will guide you through some methods to fix the issue of computer auto-restarting after shutdown or entering Sleep mode Sleep.
Method 1: Disable Fast Startup
Windows 10 comes with Fast Startup mode, which doesn't shut down the computer conventionally but keeps it in a hybrid state so that the reopening process is faster for users. However, this can also be the cause of errors leading to the computer auto-restarting when plugged in, so the solution is to disable Fast Startup.
If you're unsure how to disable Fast Startup, refer to the article on Disabling Fast Startup, fixing black screen errors during startup in win 8 and win 10 on Mytour for guidance.
Method 2: Preventing Task Scheduler from Waking Up the Computer
Sometimes the culprit causing the computer to restart after shutdown, or multiple restarts, is more likely software than hardware. You may be using Scheduled Tasks to monitor and complete some tasks at specific times throughout the day. In this case, to fix the auto-restarting issue, you need to change Power settings to ensure the device ignores tasks when in Standby or Hybrid mode.
Step 1: Open Power Options => select Change Plan Settings.
Step 2: Ensure you've selected the correct Power plan, then choose Change advanced Power settings.
Step 3: Expand the Sleep section to find the Allow Wake Timers option and disable this option.
The above steps ensure no program can wake up the computer even when the device is in sleep mode or when shut down.
Note: This method applies only to laptops.
Method 3: Disable Automatic Restart
If your computer frequently hangs and the system restarts automatically, the cause could be the Automatic Restart feature. The solution to this issue is to disable Automatic Restart to fix the problem of continuous computer restarts without displaying anything on the screen.
- Type System into the Search box on the Start menu.
- From the search results list, click to open the System window.
- On the left pane, select Advanced system settings =>tab Advanced.
- In the Startup and Recovery section, click Settings.
- Uncheck the box for Automatically Restart then click OK.
Method 4: Mouse or Keyboard Waking Up the Computer
Additionally, the mouse or keyboard could also be the culprit behind continuous computer restarts. Sometimes, even a slight touch on the keyboard or mouse can trigger the computer to start up when in sleep mode, ... .
These devices include power management options, which we can disable to ensure these accessories don't wake up the computer unless we intend them to.
Open Device Manager by pressing Windows + X and then pressing M key. In this window, you'll see a list of all computer hardware. Here, select the mouse or keyboard.
Right-click on it, select Properties, then click on the PowerManagement tab and uncheck the option Allow this device to wake the computer.
Apart from the mouse and keyboard, if you're using other gaming devices to play games on your computer, you'll need to disable the power options for these devices as well.
To find the devices causing the wake-up, leading to computer restarts, we use the command powercfg -lastwake introduced by Mytour above. Try disabling each device to identify the one causing the error.
Note: Ensure either the keyboard or the mouse, at least one of them, has the ability to wake up the computer if you don't want to press the Power button every time you wake, or boot up, the computer from various sleep modes.
Method 5: Disable Wake On LAN Feature
If your computer is connected to a network, Wake On LAN can bring the computer back online. This feature is extremely useful if a computer needs to communicate or send data, files to another computer on the same network only when requested.
Wake On LAN is integrated into the hardware, namely the network card, and can also be the cause of waking up the computer and causing errors that lead to automatic restarts. To fix the issue of computer auto-restarting, we will disable the Wake On LAN feature.
Open Device Manager by pressing Windows + X and then pressing M key. In the Network Adapters section, find any network, typically labeled as Miniport.
Right-click on it, select Properties =>Power management => Uncheck the option Allow this device to wake up the computer.
This is to ensure that no computer on the network can wake up, causing your computer to restart.
Method 6: Prevent Windows from Automatically Updating and Maintaining
Depending on the time you've set or the default schedule, Windows Update may have restarted your PC to complete the update process. Additionally, Windows also integrates Automatic Maintenance mode to wake up the computer at the set time and update all available updates on the computer.
Open Settings =>Windows Update and Security =>Windows Update => select Active Hours.
To adjust the time for Automatic maintenance, type Automatic maintenance into the Search box on the Start menu, from the search results list to open the window. Here, you can change the time or uncheck the box Allow scheduled maintenance to wake up my computer at the scheduled time to finish.
This article by Mytour has just guided you through some ways to fix computer auto-restarting when in sleep mode or even when turned off. Additionally, if you have any questions or queries needing answers, readers can leave their comments below the article for assistance.
