Use the Windows key + R keyboard shortcut to open the Run command, type regedit, and click OK to open the registry.
Browse the following path:
HKEYLOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\7516b95f-f776-4464-8c53-06167f40cc99\8EC4B3A5-6868-48c2-BE75-4F3044BE88A7
On the right side, double-click the Attributes DWORD.
Change the value from 1 to 2.
Click OK.