Created
November 24, 2020 17:39
-
-
Save falldeaf/89ccc1775239237d5b49ffca25aeb7f8 to your computer and use it in GitHub Desktop.
PowerShell script to keep your locked down computer from going to sleep
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
Clear-Host | |
Echo "Keep-alive with Scroll Lock..." | |
$WShell = New-Object -com "Wscript.Shell" | |
while ($true) | |
{ | |
$WShell.sendkeys("{SCROLLLOCK}") | |
Start-Sleep -Milliseconds 100 | |
$WShell.sendkeys("{SCROLLLOCK}") | |
Start-Sleep -Seconds 240 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment