Created
October 2, 2020 00:08
-
-
Save mminer/42d900ec668433ac81fe7f1cf8001b18 to your computer and use it in GitHub Desktop.
PowerShell script to keep Windows session alive by repeatedly toggling numlock.
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
$wshell = New-Object -ComObject WScript.Shell | |
while ($true) { | |
Write-Output "$(Get-Date) Toggling numlock" | |
$whell.SendKeys('{NUMLOCK}') | |
Start-Sleep -Seconds 10 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment