Add-Type -AssemblyName System.Windows.Forms
$sleep = 240
$i = 0
while ($true) {
$Pos = [System.Windows.Forms.Cursor]::Position
if (($i % 2) -eq 0) {
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point((($Pos.X) + 1) , $Pos.Y)
}
else {
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point((($Pos.X) - 1) , $Pos.Y)
}
$i++
Start-Sleep -Seconds $sleep
}
Created
August 9, 2023 14:07
-
-
Save AnatomicJC/857199c146918b0782710c5f730b0f6f to your computer and use it in GitHub Desktop.
Prevent desktop lock or screensaver with PowerShell
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment