I have a program that uses WinActivate with sendkey to keep an application running every 30 minutes but the problem is when the computer goes into screensaver about every 2 minutes my program doesn't keep the application running. I have a mouse mover and it works when I remember to put it on but sometimes I forget. Is there a script that can be used to keep it from going into screensaver? Company policy prevents me from changing the time limit.
Running Win11 with WinBatch 2020A
Why does your program need keyboard input to keep running? Have you considered other approaches to maintaining the program's operation? If not, have you considered the WinBatch MouseMove or MousePlay functions in a loop to prevent the screensaver from activating?
A Windows screensaver operates in a separate desktop from the current user's desktop. User input goes to the active desktop which is the screensaver desktop when the screensaver is activated.
As far as keeping the application running keystrokes seem to be the best for now. I have tried mouse moves but the didn't seem to work.
I fought the Windows 10+ screensaver for years... No matter what registry entries I entered, at some point Windows would note that I am not active on it (I was monitoring the screen, but Bill didn't know that) and would "lock" the screen.
I tried every tweak, registry entry and esoteric incantation that I could find, nothing worked. Until I discovered that if I was playing music, this did not happen.
Now I start VLC with volume set to below 5 (Tools - Preferences - Audio - "Always reset audio level to" 5%) and let it loop an mp3 file... and hide VLC. Voila, computer never locks na'more.
Outside the multitude of keep alive scripts, Windows Power Tools has an 'awake' setting that can se set to indefinite. Power Tools is free.