Search code examples
vbscriptautomation

How to prevent auto-locking feature of an XP machine using VBscript


machine get locked during the automation script run-time , this is because there is a long interval between different scripts that(this is required for some reasons) . I want to avoid this auto locking feature. The problem is, as per security policies we cannot disable this feature from control panel. Is there any other way to keep the system unlocked?


Solution

  • I'd think that you could halt the locking by sending a keypress at regular intervals, so I'd suggest looking at WScript.SendKeys. Then put that in a loop with a sleep to make it send it regularly.

    Just be careful about what key you're sending so you don't affect anything else though.