|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# https://recruit-it-remote-works.com/remomaga/no-download-mouse-auto-move-powershell/ Add-Type -TypeDefinition @" using System; using System.Runtime.InteropServices; public class MouseJiggler { [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo); public const long MOUSEEVENTF_MOVE = 0x0001; public static void Jiggle() { mouse_event(MOUSEEVENTF_MOVE, 1, 0, 0, 0); mouse_event(MOUSEEVENTF_MOVE, -1, 0, 0, 0); } } "@ while ($true) { [MouseJiggler]::Jiggle() Start-Sleep -Seconds 30 } |
|
1 2 3 4 5 6 7 8 |
# .vbs # Task [Microsoft Windows Based Script Host] Set obShl = WScript.CreateObject("WScript.Shell") Do WScript.Sleep 5*60*1000 obShl.SendKeys "%+{TAB}" Loop |