Last active
December 3, 2023 05:31
-
-
Save karoltheguy/eb0eedcbdf14f53bc9e59c6a93404649 to your computer and use it in GitHub Desktop.
Set powercfg suspend timer of current power profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set TIMEOUT_SECONDS=%1 | |
for /f "tokens=4 skip=1" %%f in ('powercfg -list ^| findstr \*') do set GUID=%%f | |
SET SUB_SLEEP=238c9fa8-0aad-41ed-83f4-97be242c8f20 | |
SET STANDBYIDLE=29f6c1db-86da-48c5-9fdb-f2b67b1f44da | |
powercfg -setacvalueindex %GUID% %SUB_SLEEP% %STANDBYIDLE% %TIMEOUT_SECONDS% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to suspend after 1hr:
set_suspend_timer 3600