This tutorial will show you how to enable or disable automatically lock computer after specified seconds of inactivity for all users in Windows 10 and Windows 11.
When you lock the computer, it protects the computer from unauthorized use when you need to step away from the PC, and don't want to sign out or shut down causing everything open to be closed.
When you lock the computer, you will be taken to the lock screen by default to dismiss and sign in when ready to continue where you left off. Other users can still sign in to their accounts from the sign-in screen.
The Interactive logon: Machine inactivity limit security policy setting allows you to specify an amount in seconds of user inactivity to wait before Windows will automatically lock the computer.
You must be signed in as an administrator to enable or disable automatically lock computer after inactivity.
If your device has a presence sensor, then you can also turn on/off Walk away lock instead that turns off the display and automatically locks the computer when you walk away for more than a set amount of seconds.
Presence detection settings location will vary per device brand and model.
- Option One: Enable or Disable Automatically Lock Computer after Inactivity in Local Security Policy
- Option Two: Enable or Disable Automatically Lock Computer after Inactivity in Registry Editor
Local Security Policy is only available in the Windows 11 Pro, Enterprise, and Education editions.
All editions can use Option Two to set the same policy.
1 Open Local Security Policy (secpol.msc).
2 Double click/tap on Local Policies in the left pane to expand, and click/tap on Security Options to open it. (see screenshot below)
3 In the right pane of Security Options, double click/tap on the Interactive logon: Machine inactivity limit policy to open its properties. (see screenshot above)
4 Enter a number between 0 to 599940 for how many seconds of inactivity you want to automatically lock computer after, and click/tap on OK. (see screenshot below)
The default is 0 (zero) seconds to not automatically lock the computer.
5 Close the Local Security Policy window.
6 Restart the computer to apply.
1 Open Registry Editor (regedit.exe).
2 Navigate to the registry key below in the left pane of Registry Editor. (see screenshot below)
3 In the right pane of the System key, double click/tap on the InactivityTimeoutSecs DWORD to modify it. (see screenshot above)
If you do not have a InactivityTimeoutSecs DWORD, right click or press and hold on an empty space in the right pane of the System key, click/tap on New, click/tap on DWORD (32-bit) Value, type InactivityTimeoutSecs for the name, and press Enter.
4 Select (dot) Decimal, enter a number between 0 to 599940 for how many seconds of inactivity you want to automatically lock computer after, and click/tap on OK. (see screenshot below)
The default is 0 (zero) seconds to not automatically lock the computer.
5 Close Registry Editor.
6 Restart the computer to apply.
That's it,
Shawn Brink
- Lock Computer in Windows 11
- Enable or Disable Lock Computer in Windows 11
- Enable or Disable Ctrl+Alt+Delete Secure Sign-in on Lock Screen in Windows 11
- Turn On or Off Dynamic Lock to Automatically Lock Windows 11
- Enable or Disable Lock Screen in Windows 11
- Add or Remove Lock in Power Menu on Start Menu in Windows 11
- Change Lock Screen Timeout to Turn Off Display After in Windows 11
- Turn On or Off Screen Saver in Windows 11
- Change Screen Saver Grace Period to Require Sign-in in Windows 11