Skip to content

Instantly share code, notes, and snippets.

@mortalis13
Last active February 22, 2024 09:30
Show Gist options
  • Save mortalis13/01e9d0db3c188525e7fa2d17f0a7e90f to your computer and use it in GitHub Desktop.
Save mortalis13/01e9d0db3c188525e7fa2d17f0a7e90f to your computer and use it in GitHub Desktop.
# Script to trigger ScrollLock key each 10 min
# Save as script.ps1 and run from PowerShell or from context menu "Run with PowerShell"
$WShell = New-Object -Com "Wscript.Shell"
while (1) {$WShell.SendKeys("{SCROLLLOCK}"); sleep 600}
# To execute the script in background, run it from the console
# To stop it, kill the powershell.exe process
powershell.exe -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden script.ps1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment