# PC restarts itself when locked



## Scorpion77 (Dec 31, 2018)

Hi, since I upgraded my PC I have noticed that PC restarts by itself when I lock the session. My operating system is Windows 10 Pro 21H1, but the problem also occurred with the 20H2 version.
When I lock the PC (by pressing Windows+L), it restarts by itself, I understand that it happens after about 1 minute after locking it. In the system logs I can't figure out what it could be. I have all the updated drivers.



PC Specs:

CPU: AMD Ryzen 7 5800X
Motherboard: ASRock X570 Steel Legend
GPU: AMD Radeon RX 580
RAM: Patriot 32 GB DDR4-3600


How can I solve?
Thanks in advance.


----------



## Thomas545 (Aug 30, 2021)

First thing you can do just restore to previous windows update and check if the problem still occurs._(I would do so)._
Also you could find info about the problem here (Windows Restarts when Screen is Locked).


----------



## Scorpion77 (Dec 31, 2018)

I solved!
I noticed that PC restarts after the monitor is turned off. You know that by default, when you lock the session, a background image appears with date and time, and after 1 minute Windows turns off the monitor (if I remember correctly, this feature appeared with Windows 8). Then just move the mouse or press a key and the screen comes back on asking for the account password.
I tried to turn off all power saving, but when it goes to turn off the monitor restarts. It only does this when session is locked. If you set from power saving to turn off the monitor, for example after 1 minute of inactivity, the screen turns off and the PC does not restart.
Then I remembered that I had turned off hibernation with the "powercfg -h off" command. So I figured that somehow it's like the hibernation is active and malfunctioning.
I reactivated it with the command "powercfg -h on" and now, after 1 minute that the session is blocked, the monitor is turned off but the pc does not restart. Of course the hiberfil.sys file takes up more than 13 GB of my SSD. Patience. I thought, at least I solved the problem. But no!
Doing other tests, if the "Turn off the display" setting is set to any value other than never, even with "powercfg -h on" the PC will restart after the monitor is turned off.
Unfortunately, I cannot take advantage of the convenience that after 1 minute of a locked session the screen is turned off, in order to prevent it from being damaged by leaving the same image for too long. Unfortunately I'll have to manually turn off the monitor after I have locked the session. Needless to say that with Linux I have no problem and I have set that after 1 minute of session lock on KDE Plasma the screen will turn off.


----------

