-
-
Save si-hyeon/520e73a65ed831cf09213d94895d8943 to your computer and use it in GitHub Desktop.
Powershell script to keep the mouse moving
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
| # This way works not well for screensaver activated by secure program. | |
| # For preventing screensaver, see https://gist.github.com/si-hyeon/d8430d132bda8c2b1a689c5d11d5a60d | |
| Add-Type -AssemblyName System.Windows.Forms | |
| while ($true) | |
| { | |
| $pos = [System.Windows.Forms.Cursor]::Position | |
| $x = $pos.X + 1 | |
| $y = $pos.Y + 1 | |
| [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y) | |
| Start-Sleep -Seconds 60 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment