Skip to content

Instantly share code, notes, and snippets.

@creatigent
Forked from MatthewSteeples/mousemove.ps1
Created April 22, 2022 14:55
Show Gist options
  • Save creatigent/4189580bb4b0af1a1d65cade263251f0 to your computer and use it in GitHub Desktop.
Save creatigent/4189580bb4b0af1a1d65cade263251f0 to your computer and use it in GitHub Desktop.
Powershell Script to keep the mouse moving
Add-Type -AssemblyName System.Windows.Forms
while ($true)
{
$Pos = [System.Windows.Forms.Cursor]::Position
$x = ($pos.X % 500) + 1
$y = ($pos.Y % 500) + 1
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
Start-Sleep -Seconds 10
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment