Last active
September 12, 2022 06:50
-
-
Save ohsyln/351895a356a61ce7dd17163e0054c44f to your computer and use it in GitHub Desktop.
Prevent screen lock when idle due to company policy (Win)
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
REM Sends a keystroke at fixed intervals to prevent screen lock | |
REM Bypasses most group policies that prevent execution of scripts in general | |
REM As long as you can run "cmd.exe" and "mshta.exe", this should work | |
REM 1) Open cmd.exe | |
REM 2) Copy-paste the command in cmd.exe and press enter | |
for /L %N in () do mshta vbscript.Execute("CreateObject(""wscript.shell"").sendkeys(""{SCROLLLOCK 2}"")")(close.window) && ping localhost -n 119 1>nul |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment