Skip to content

Instantly share code, notes, and snippets.

@jkenge
Forked from MatthewSteeples/mousemove.ps1
Last active October 1, 2018 08:55
Show Gist options
  • Select an option

  • Save jkenge/52ad4a2b1d08b76840713ba5a660ef15 to your computer and use it in GitHub Desktop.

Select an option

Save jkenge/52ad4a2b1d08b76840713ba5a660ef15 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) + 80
$y = ($pos.Y) + 0
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
$x = ($pos.X) - 0
$y = ($pos.Y) - 0
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
Start-Sleep -Seconds 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment