Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I suspect you can do this using API calls to powrprof.dll, as well as WMI, but I haven't had the time to figure that approach out.</p> <p>This setting appears to be simply a boolean registry key that is located according to your current power plan:</p> <blockquote> <p>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes\(Current Power Scheme GUID)\(Sleep Category GUID)\(Enable AC or DC Wake Timers GUID) = 0 or 1</p> </blockquote> <p>Rather than manipulating the registry directly a cleaner approach would be to enable these settings using powercfg.exe.</p> <p>For AC power:</p> <p><code>powercfg.exe -SETACVALUEINDEX SCHEME_CURRENT SUB_SLEEP bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d 1</code></p> <p>For Batteries:</p> <p><code>powercfg.exe -SETDCVALUEINDEX SCHEME_CURRENT SUB_SLEEP bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d 1</code></p> <p>EDIT:</p> <p>This enables wake timers on my system when running on AC power using High Performance power scheme (purely as a proof of concept):</p> <pre><code>[DllImport("powrprof.dll", EntryPoint = "PowerWriteACValueIndex", CharSet = CharSet.Auto, SetLastError = true)] public static extern uint PowerWriteACValueIndex(IntPtr RootPowerKey, ref Guid SchemeGuid, ref Guid SubGroupOfPowerSettingsGuid, ref Guid PowerSettingGuid, uint AcValueIndex); public static void EnableWakeTimers() { Guid Root = new Guid("8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"); // High Performance GUID Guid Sleep = new Guid("238c9fa8-0aad-41ed-83f4-97be242c8f20"); // Sleep Subcategory GUID Guid WakeTimers = new Guid("bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d"); // Wake Timers GUID PowerWriteACValueIndex(IntPtr.Zero, ref Root, ref Sleep, ref WakeTimers, 1); } </code></pre> <p>This reference is your friend: <a href="http://msdn.microsoft.com/en-us/library/aa373163%28v=vs.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa373163%28v=vs.85%29.aspx</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload