How To Prevent Security Policy Enforced Screen Lock in Windows

We are all believe security. But sometimes security become a bottleneck for our productivity. Enterprises generally put automatic screen lock after idle time for windows operating systems by using security policy.

I think this is very good enforcement because I see a lot of workers do not mind this type of security measures. But when using windows in vm it become a bottleneck entering password for a lot of times. Here is a script based solution. Save this script as idle.vbs and then double click it or more convenient start it with task manager for start at startup automatically.

1

2

3

4

5

6

7

8

9

Dim objResult

Set objShell=WScript.CreateObject("WScript.Shell")

i=

DoWhilei=

objResult=objShell.sendkeys("{NUMLOCK}{NUMLOCK}")

Wscript.Sleep(6000)

Loop

6000 means 6 seconds the script sends NUMLOCK to prevent screen lock. We can change it according our policy interval.