Created
January 22, 2021 13:23
-
-
Save raresteak/82248393f3927a118dfec184fbcb6be1 to your computer and use it in GitHub Desktop.
Simulate key press - keep screen from locking
This file contains hidden or 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
$WShell = New-Object -com "Wscript.Shell" | |
while ($true) | |
{ | |
Echo "Key press" | |
$WShell.sendkeys("{SCROLLLOCK}") | |
Start-Sleep -Milliseconds 100 | |
$WShell.sendkeys("{SCROLLLOCK}") | |
Start-Sleep -Seconds 300 | |
} | |
# Original author https://gist.github.com/AndrewDavis, https://gist.github.com/MatthewSteeples/ce7114b4d3488fc49b6a#gistcomment-2946126 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment