Created
April 1, 2025 20:18
-
-
Save nask0/7cb21256d36a166fc5e2f1b3da595801 to your computer and use it in GitHub Desktop.
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
$MYJOB = Start-Job -ScriptBlock | |
{ | |
$SLEEPTIME = 5 | |
#$MOVEMENTSIZE = 10 | |
$MOVEMENTSIZE = Get-Random -Minimum 1 -Maximum 128 | |
$WShell = New-Object -Com "Wscript.Shell" | |
Add-Type -AssemblyName System.Windows.Forms | |
while ($true) { | |
$POSITION = [Windows.Forms.Cursor]::Position | |
$POSITION.x += $MOVEMENTSIZE | |
$POSITION.y += $MOVEMENTSIZE | |
[Windows.Forms.Cursor]::Position = $POSITION | |
$WShell.SendKeys("{SCROLLLOCK}"); | |
Start-Sleep -Seconds $SLEEPTIME | |
$POSITION = [Windows.Forms.Cursor]::Position | |
$POSITION.x -= $MOVEMENTSIZE | |
$POSITION.y -= $MOVEMENTSIZE | |
[Windows.Forms.Cursor]::Position = $POSITION | |
$WShell.SendKeys("{SCROLLLOCK}"); | |
Start-Sleep -Seconds $SLEEPTIME | |
} | |
} | |
# To run: PowerShell.exe -NoExit -ExecutionPolicy Bypass -File C:\DontSleep.ps1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Keeps Windows machine "awake". For employees that doesn't like to be tracked by their employer.