Disable Windows 10 sleep via CMD

Simple method to disable Windows 10 sleep via a command / batch script for users.

@echo off
for /f "tokens=4 delims= " %%i IN ('powercfg -q ^| find "Power Scheme GUID:"') do Set StrOne=%%i
for /f "tokens=3 delims= " %%i IN ('powercfg -q ^| find "(Power buttons and lid)"') do Set StrTwo=%%i 
for /f "tokens=4 delims= " %%i IN ('powercfg -q ^| find "(Lid close action)"') do Set StrThree=%%i 
powercfg -SETACVALUEINDEX %StrOne% %StrTwo% %StrThree% 000

If you found this article helpful, would you consider buying me a Coffee?