Prevent automatic logout in Windows 10

How do I prevent an automatic screen lock in Windows 10, which is set by policy?

Many companies use special policies for their company PCs which, for example, also automatically lock the computer after a set time if the computer is not being used. This can sometimes be annoying and the setting is locked for the user.

We show two ways to stop the computer from being locked automatically.

Table of content

Media Player

The computer is not automatically locked when you play media. You can use Windows Media Player to open a video or audio file, activate endless playback and set the sound to 0.

Then simply let the video/audio run in the background. The computer no longer locks up

VBS script

A second possibility is to use a Visual Basic script. This does not always have to work, as the execution of such scripts can also be disabled for security reasons.

Here is an example script:

Dim objResult
Set objShell = WScript.CreateObject("WScript.Shell")
Do While True
  objResult = objShell.sendkeys("{NUMLOCK}{NUMLOCK}")
  Wscript.Sleep (20000)
Loop

This script is saved with a text editor as a text file with the extension .vbs.

Then we start the file. The script is now activated in the background and press the Num-Lock key twice every 20 seconds.

This simulates a regular keystroke. To end the script, restart the computer or end the “wsscript” task via the task manager.

Both tips are to be used at your own risk. 🙂

Bestseller No. 2
Windows 10 Inside Out
  • Bott, Ed (Author)

Leave a Reply

Your email address will not be published. Required fields are marked *