Make windows honor my setting to do nothing when I close the lid of my computer
The issue is that the setting in the control panel is not changing the attribute in the registry. This could be due to a group policy, a third party power management tool, or a windows bug.
- run the following command in a cmd prompt to see what power settings are being honored by your system:
PowerCfg /q
- Find the GUID setting for closing your lid. For me its
Subgroup GUID: 4f971e89-eebd-4455-a8de-9e59040e7347
Power Setting GUID: 5ca83367-6e45-459f-a27b-476b1d01c936 Notice the current setting is 1. That means it will sleep when the lid is closed. - Open regedit. (You can search for it in the start menu)
- Go to the following entry:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\4f971e89-eebd-4455-a8de-9e59040e7347\5ca83367-6e45-459f-a27b-476b1d01c936
- Change the
Attributes
Key to have a DWORD value of0
- If you want to change the other power profiles you can go into the
DefaultPowerSchemeValues
subfolder and change thoseAttributes
values to be0
as well
The answer above is technically correct, however, I found an additional thing I had to do to actually stop my laptop from entering sleep mode.
I had previously selected the Performance power plan, but recently discovered there were a few options not being honored. So just on a whim, I thought I would try setting my laptop back to the Balanced power plan and adjsuting its settings to suit my needs. Lo and behold the settings all of a sudden all started being honored. I also noted that the previously selected Performance power plan disappeared from my list of power plan options. So it would appear one of the recent Windows Updates has potentially removed the Performance power plan from the default list of options, and I assume therefore only offering partial backwards compatibility.
Hope this helps anybody still struggling with this annoying behavioural glitch.