Windows 7 Allow Hybrid Sleep
For a lot of PCs (especially laptops and tablets), your PC goes to sleep when you close your lid or press the power button. To make your PC sleep: Open power options: For Windows 10, select Start, then select Settings System Power & sleep Additional power settings.
how can I turn off 'allow hybrid sleep' in advanced power setting? by c#by manually: power options -> change Plan Settings -> change advanced power setting-> Sleep-> 'Allow hybrid sleep' -> plugged in: OFF
sari ksari k2 Answers
If you are targeting Windows 7/2008 Server then you can use WMI and the Win32_PowerSetting class. Below is code that does that. Make sure to add an assembly reference and using
directive to System.Management
.
Windows 7 Allow Hybrid Sleep Center
Chris HaasChris HaasUsing procmon, I managed to work out that the following registry key is responsible for it on my machine.
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlPowerPowerSettings238C9FA8-0AAD-41ED-83F4-97BE242C8F2094ac6d29-73ce-41a6-809f-6363ba21b47e
You'll probably have to do some research on your machine to see how it works for you.
You can also call on the powercfg utility to do this. Each power setting is identified by three things:
- GUID of power profile
- GUID of profile subgroup
- GUID of setting
You can use powercfg -QUERY
to produce a full list of values.
Once you've got the GUID of the profile you want to edit, the GUID of the subgroup (in this case the Sleep subgroup) and the GUID of the setting (Allow Hybrid Sleep) you can use either powercfg -SETACVALUEINDEX
for plugged in or powercfg -SETDCVALUEINDEX
for on battery to set the value.
Windows 7 Allow Hybrid Sleep Missing
In my case (Win7 Ultimate x64) you can turn it off using:powercfg -SETACVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 238c9fa8-0aad-41ed-83f4-97be242c8f20 94ac6d29-73ce-41a6-809f-6363ba21b47e 1
This translates to the AcSettingIndex value in:HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlPowerPowerSettings238C9FA8-0AAD-41ED-83F4-97BE242C8F2094AC6D29-73CE-41A6-809F-6363BA21B47EDefaultPowerSchemeValues381b4222-f694-41f0-9685-ff5bb260df2e
Win7 Allow Hybrid Sleep
PolynomialNot the answer you're looking for? Browse other questions tagged c# or ask your own question.
Comments are closed.