Prevent lockscreen

Your company configured all computers in the network via Active Directory to lock a machine after a period of time the computer was not used. In case you have administrative user rights, you can user this small script which imitates hidden user input via keyboard.

Mainly it sends the key "F15" to the OS which doesn't have any Windows funtions assigned and will not print any readable characters. You can of course configure any key you want to send to the OS. Keep in mind, that other keys than F15 may not prevent your OS to get locked.

Executed with the included batch file "start.bat" it will execute a Powershell script in the background, so it does not interrupt you during your work.

Powershell is restricted not to execute scripts by default. So i implemented in the start.bat batch, to set the execution policy to "unrestricted" via system registry. In the Powershell script itself - whose execution would have been prevented - the execution policy will immediately be reset to "restricted" but the script itself will be run until you terminate it with exit.bat or taskmanager.

Download: prevent_lock.zip