How to lock your Windows 11 PC automatically after a time frame

To lock your Windows 11 PC automatically after a set time, turn on a screen saver, set its Wait time in minutes and tick On resume, display logon screen.

This guide also covers Dynamic lock, sleep timeouts, the machine inactivity limit policy, the registry value behind it, Task Scheduler's limits, instant lock shortcuts and fixes when the PC refuses to lock.

How to Lock Your Windows 11 PC Automatically After a Time Frame
Set the Wait time in minutes and tick On resume, display logon screen so the PC locks after that idle period. (Image: Microsoft Q&A)

Method 1: Use screen saver settings to auto-lock PC

The screen saver route works on every Windows 11 edition, including Home, and lets you pick the idle time in minutes.

The lock comes from the On resume, display logon screen box, not from the screen saver itself.

  1. Select Start > Settings > Personalization > Lock screen.
  2. Under Related settings, select Screen saver.
  3. Pick any screen saver from the Screen saver list, such as Blank.
  4. Set Wait to the number of idle minutes before the PC locks, for example 5.
  5. Tick On resume, display logon screen.
  6. Select Apply, then OK.

You can open the same dialog by running control desk.cpl,,1 from Command Prompt. If you also want a new screen saver style, you can change the screen saver in the same dialog.

Which Windows 11 auto-lock method should you use?

Your situation Use this Why
Any edition, simple idle lock Screen saver with On resume, display logon screen Set in minutes, no admin tools
You carry your phone when you leave Dynamic lock Locks within about a minute of the phone leaving Bluetooth range
You want the screen off and power saved too Sleep timeout in Power & battery Waking from sleep brings back the sign-in screen
Pro, Enterprise or Education PC Interactive logon: Machine inactivity limit A device-wide policy measured in seconds
No policy editor available InactivityTimeoutSecs registry value The value the policy writes
Laptop with a presence sensor Presence sensing Turns the screen off when you walk away

Method 2: Use Dynamic Lock to lock PC when you walk away

Dynamic lock pairs Windows with your phone over Bluetooth and locks the PC when the signal drops below a set level.

It needs Bluetooth on the PC and the phone, but no internet or Wi-Fi connection.

  1. Pair your phone with the PC over Bluetooth in Settings > Bluetooth & devices.
  2. Open Settings > Accounts > Sign-in options, or run ms-settings:signinoptions from the Run box.
  3. Scroll to Additional settings and expand Dynamic lock.
  4. Turn on the option that lets Windows lock your device automatically when you are away.
  5. Take the phone with you when you leave; Windows locks within a minute after you are out of Bluetooth range.

Dynamic lock is a walk-away trigger, not a timer. Pair it with the screen saver method if you also want a lock while you sit at the desk idle.

Lock Windows 11 PC automatically with the Dynamic lock toggle in Sign-in options
Dynamic lock sits under Additional settings in Accounts > Sign-in options and needs a phone paired over Bluetooth first. (Image: Microsoft)

Method 3: Lock automatically using power & sleep settings

Sleep ends the session's display and returns you to the sign-in screen on wake when your account has a password, PIN or Windows Hello.

Windows 11 holds separate values for plugged in and on battery.

  1. Select Start > Settings > System > Power & battery.
  2. Expand Screen, sleep, & hibernate timeouts.
  3. Set Turn my screen off after to a short time, such as 3 or 5 minutes.
  4. Set Make my device sleep after to the time frame you want before the PC sleeps.
  5. Repeat both values for battery power on a laptop.

On a PC with a presence sensor, the same page has Screen and sleep options such as Automatically turn off my screen when I leave. When the machine inactivity limit policy is set, Windows also locks when the display turns off because of these power settings.

Method 4: Lock automatically via Group Policy Editor (Windows 11 Pro & Enterprise)

Interactive logon: Machine inactivity limit locks the session after a number of idle seconds for every user on the PC.

It is off by default, and the policy applies to Pro, Enterprise and Education editions.

  1. Press Windows + R, type secpol.msc and press Enter, or open gpedit.msc.
  2. Go to Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options.
  3. Double-click Interactive logon: Machine inactivity limit.
  4. Enter the idle time in seconds, for example 300 for 5 minutes. The range is 0 to 599940.
  5. Select OK.
  6. Restart the PC so the new limit takes effect.

A value of 0 or a blank box disables the policy, so the session never locks from inactivity.

Method 5: Automatically lock using Registry Editor (advanced users)

The machine inactivity limit policy stores its value as InactivityTimeoutSecs, a REG_DWORD measured in seconds.

Back up the key before you edit it, because a wrong value change affects every account on the PC.

  1. Press Windows + R, type regedit and press Enter, then select Yes at the UAC prompt.
  2. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System.
  3. Right-click System, select New > DWORD (32-bit) Value and name it InactivityTimeoutSecs.
  4. Double-click the value, select Decimal and enter the idle seconds, such as 600 for 10 minutes.
  5. Select OK, close Registry Editor and restart the PC.

To undo the change, delete InactivityTimeoutSecs or set it to 0 and restart. The per-user screen saver values ScreenSaveActive, ScreenSaverIsSecure and ScreenSaveTimeOut sit under HKEY_CURRENT_USER\Control Panel\Desktop and are what Method 1 writes.

Method 6: Use Task Scheduler to trigger automatic lock

Task Scheduler can start a task when the PC goes idle, but Windows ships no built-in Task Scheduler action that locks the session.

Locking is done by the LockWorkStation function, which only works for a signed-in user on the interactive desktop, so a task running in the background cannot lock the screen.

What you want Better tool Why
Lock after a set idle time Machine inactivity limit or screen saver Both measure idle input directly and need no task
Lock when you leave the desk Dynamic lock Bluetooth distance is the trigger, not a clock
Lock at a fixed clock time each day A task that runs your own lock script while you are signed in LockWorkStation must run in your interactive session
Sleep or shut down on a schedule Task Scheduler with shutdown or power settings These actions are built in and do not need the desktop

Method 7: Third-party auto-lock utilities (optional)

Every common auto-lock need is covered by a built-in Windows 11 setting, so an extra utility adds software to maintain without adding a capability most readers need.

Feature people look for in a utility Built-in Windows 11 equivalent
Lock after X minutes idle Screen saver Wait plus On resume, display logon screen
Lock when the phone leaves Dynamic lock
Lock policy for all users Interactive logon: Machine inactivity limit
Lock when the user walks away from a laptop Presence sensing on supported hardware
One-key lock Windows + L

If you still choose a utility, download it only from the developer's own website or the Microsoft Store.

Bonus tip: lock PC instantly using shortcuts

An automatic lock is a safety net. Locking by hand as you stand up closes the gap before the timer runs out.

  1. Press Windows + L to lock the PC at once.
  2. Or press Ctrl + Alt + Delete and select Lock on the security screen.

Windows 11 also has other manual ways to lock the screen if you prefer the mouse.

How to check Windows 11 auto-lock is working

  1. Set a short test time, such as 1 minute for the screen saver or 60 seconds for the policy.
  2. Leave the keyboard and mouse untouched for longer than that time.
  3. Move the mouse and confirm Windows asks for your PIN, password or Windows Hello instead of returning to the desktop.
  4. For Dynamic lock, walk out of Bluetooth range with your phone and wait about a minute before checking.
  5. Set the time back to your normal value once the test passes.

Troubleshooting common issues with Windows 11 auto-lock

Auto lock not working

The screen saver runs without the resume box ticked, or the policy is still at 0 or waiting for a restart.

  1. Open the Screen saver dialog and confirm On resume, display logon screen is ticked.
  2. Check that a screen saver other than (None) is selected.
  3. In secpol.msc, confirm Interactive logon: Machine inactivity limit holds a value above 0.
  4. Restart the PC after changing the policy or the registry value.

Dynamic lock not responding

The phone is not paired, Bluetooth is off, or the phone is still within range.

  1. Open Settings > Bluetooth & devices and confirm Bluetooth is on and the phone is listed.
  2. Remove the phone and pair it again if it shows as disconnected.
  3. Recheck that Dynamic lock is on under Accounts > Sign-in options.
  4. Move far enough away and wait at least a minute before testing.

Power settings overriding lock timer

The screen turns off or the PC sleeps before your lock timer is reached.

  1. Open Settings > System > Power & battery > Screen, sleep, & hibernate timeouts.
  2. Set Turn my screen off after longer than the screen saver Wait time if you want the screen saver to show first.
  3. Remember that with the machine inactivity limit set, a display turning off also locks the PC.

Screen saver options are greyed out

A policy under User Configuration > Administrative Templates > Control Panel > Personalization controls the screen saver.

  1. On a work PC, ask your IT administrator; the policy is set centrally.
  2. On a personal Pro PC, open Group Policy Editor with gpedit.msc and review Enable screen saver, Password protect the screen saver and Screen saver timeout under that path.
  3. Set them to Not configured to control the screen saver from Settings again.
Windows 11 auto-lock not working with screen saver None and Wait greyed
With (None) selected the Wait box and the logon screen option stay inactive, so pick a screen saver first. (Image: Microsoft Q&A)

Why you should automatically lock your PC

An unlocked, unattended PC gives anyone nearby your open email, files and signed-in accounts.

Security benefit of auto-locking What it protects
Blocks access when you forget to lock Open apps, documents and browser sessions
Protects signed-in accounts Email, cloud storage and work tools that stay signed in
Limits shoulder-surfing in shared spaces Whatever is on screen when you step away
Pairs with sleep timeouts Battery life and screen wear as well as privacy

Best practices for auto-lock settings in Windows 11

Where the PC is used Suggested idle time Method
Public or shared area 1 to 5 minutes Machine inactivity limit or screen saver
Office desk 5 to 10 minutes Screen saver plus Dynamic lock
Home, trusted people only 10 to 15 minutes Screen saver or sleep timeout
Laptop on the move 3 to 5 minutes on battery Sleep timeout plus Windows + L habit

Microsoft's guidance is to base the time on the device's location: shorter in public areas, longer where only trusted people have access. Always use a PIN or password, because a lock without one opens with a key press.

Windows 11 auto-lock frequently asked questions

What is the default lock timeout in Windows 11?

Windows 11 has no idle lock timer turned on by default; the machine inactivity limit policy is disabled out of the box. What locks most PCs is sleep: newer devices turn the screen off after 3 to 5 minutes and sleep after 3 to 15 minutes depending on hardware and power source.

Can I set different auto-lock times for battery and plugged-in modes?

Yes, through sleep and screen timeouts. Under Settings > System > Power & battery > Screen, sleep, & hibernate timeouts, a laptop shows separate plugged in and on battery values. The screen saver and the inactivity policy use one value for both.

Does Dynamic Lock require internet or Wi-Fi?

No. Dynamic lock uses a Bluetooth connection between the PC and a paired phone. When the Bluetooth signal drops below a set level, Windows locks within about a minute. Wi-Fi and internet access play no part in it.

Can I disable auto-lock later?

Yes. Untick On resume, display logon screen in the Screen saver dialog, turn off Dynamic lock in Sign-in options, and set the machine inactivity limit or the InactivityTimeoutSecs value to 0, then restart the PC.

Is auto-lock available in Windows 11 Home edition?

Yes. The screen saver lock, Dynamic lock and sleep timeouts all work on Home. Microsoft documents the machine inactivity limit policy for Pro, Enterprise and Education editions, so Home users should rely on the screen saver lock.

How do I lock my Windows 11 PC instantly?

Press Windows + L. You can also press Ctrl + Alt + Delete and select Lock on the security screen. Both return you to the lock screen without closing your apps.

What is the maximum machine inactivity limit?

The policy accepts 0 to 599,940 seconds, which is about 166.65 hours. A value of 0 or a blank box disables it. The change needs a restart before Windows applies it.

Philip Celasco

Philip is a Texas-based technology writer and IT administrator at Techdows.com with more than 10 years of experience creating practical content for everyday users and professionals. He specializes in web browsers, particularly Chromium-based platforms such as Google Chrome, Microsoft Edge, Brave, and Opera. Through his work as an IT administrator, Philip has hands-on experience managing devices, configuring browser policies, troubleshooting software and network issues, and helping people resolve problems that affect productivity and security. His articles are based on practical testing and real-world technical experience. He covers browser settings, extensions, performance problems, privacy controls, security features, and Windows troubleshooting. Outside work, Philip enjoys the quieter side of life in Texas and stepping away from the screen when he can. He has two kids, two cats and loves to play golf with his mother during the weekends.

Leave a Reply

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