Setting Up Your Windows 11 Computer to Lock Itself When Idle



This post details the steps needed to enable or disable the automatic locking of a computer after a certain period of inactivity in Windows 11. This feature is designed to enhance security by preventing unauthorized access to your files. The guide covers how to adjust this setting using both the Local Security Policy editor and…

This post describes steps one can take to enable or disable automatically to lock their computer after the inactivity limit in Windows 11

By default, Windows will automatically lock your computer when you are away to prevent other people from using your desktop and accessing your files.

When your computer is locked, it will show the lock screen by default. The lock screen is the screen or curtain you see when you turn on your computer before the sign in screen. It is also displayed once your computer is locked after you step away or press the Windows key + L.

The Interactive logon: Machine inactivity limit security policy setting allows you to specify a number in seconds of user inactivity, and if exceeded, Windows automatically locks the computer.

Below is how to change this policy, so your computer does not automatically lock or set an inactivity limit before locking.

How to enable or disable automatically locking computer after inactivity in Windows 11

As mentioned above, Windows will automatically lock your computer when you are away to prevent other people from using your desktop and accessing your files.

Below is how to change Windows security policy settings that control when and how your computer locks.

To do that, open Local Security Policy (secpol.msc) by clicking on the Start Menu and searching for Edit group policy, as highlighted below.

Under Best match, select Local Security Policy to launch Local Security Policy Editor.

In the left pane of Local Security Policy Editor, expand the tree: 

Local Policy -> Security Options

Then, locate and double-click the setting Interactive logon: Machine inactivity limit in the Security Options details pane on the right.

On the logon: Machine inactivity limit policy Properties window, enter a number between 0 to 599940 for when the user sign-in session will lock after inactivity, and click OK.

If the Machine is locked after it is set to zero (0) or has no value (blank), the policy setting is disabled, and a user sign-in session is never locked after any inactivity.

Local Security Policy is only available in the Windows 11 Pro, Enterprise, and Education editions.

If you run Windows Home and don’t have the Local Security Policy editor, open the Windows Registry editor to configure it there.

When Windows Registry opens, navigate to the tree path below:


Then, in the right pane of the System key, double click on  InactivityTimeoutSecs REG_DWORD data to open.

Note: If you don’t see data for InactivityTimeoutSecs, right-click in a blank area of the window, select New, choose DWORD (32-bit) Value, and type InactivityTimeoutSecs for the name to create one.

Then change the inactivity timeout in seconds in Decimal and click OK to save.

That should do it!


This post showed you how to enable or disable inactivity timeout before the computer automatically locks in Windows 11. Please use the comment form below if you find any errors above or have something to share.

Like this:

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.