How to lock your PC automatically after inactivity on Windows 10

Don’t leave your PC exposed when you walk away. In this guide, I'll show you how to automatically lock your device after inactivity using built-in settings, no extra software required.

Windows 10 auto-lock
Windows 10 auto-lock / Image: Mauro Huculak
  • To lock your Windows 10 PC automatically after inactivity, configure the Screen Saver settings by selecting a screen saver, setting a wait time, and enabling the option to show the logon screen on resume.
  • Alternatively, you can use Group Policy or the Registry Editor to set an inactivity timeout that locks the device after a specific period. Windows 10 does not include a direct option in the Settings app unless you use Dynamic Lock with a Bluetooth device.

When stepping away from Windows 10 for an uncertain duration in a public place or a work environment, it’s important to ensure your computer locks automatically after a period of inactivity. This measure will help to safeguard your work from unauthorized access and prying eyes.

While you can manually lock your computer using the “Windows key + L” keyboard shortcut or the Lock option from the Start menu’s user account section, Windows 10 doesn’t provide a direct setting in the Settings app to enable automatic locking after inactivity unless you configure Dynamic Lock with a Bluetooth device.

However, you can configure your computer to lock automatically using the Screen Saver settings, Group Policy, or the Registry.

In this guide, I’ll outline the steps to use screen saver settings to lock your Windows 10 session after a specific period of inactivity.

Warning: Before proceeding, it’s crucial to acknowledge the risks associated with modifying the Windows Registry. Incorrect changes can lead to system instability or operational issues. Therefore, ensure you have a full system backup before making any changes. Proceed with caution and understanding.

Lock your PC automatically after inactivity using Settings

To lock your Windows 10 session after inactivity, follow these steps: 

  1. Open Settings.

  2. Click on Personalization.

  3. Click on Lock Screen.

  4. Click the “Screen saver settings” option at the bottom of the page.

    Screen saver settings

  5. Choose a screen saver (such as Blank) in the “Screen Saver” section.

  6. Change the wait time to the period (for example, 15 minutes) before Windows 10 locks your computer automatically.

  7. Check the “On resume, display logon screen” option.

    Lock Windows 10 automatically

  8. Click the Apply button.

  9. Click the OK button.

After the specified period of inactivity, the screen saver will activate. Upon resuming, you’ll be prompted to enter your password, effectively locking your computer.

Lock your PC automatically after inactivity using Group Policy

To lock Windows 10 after a period of inactivity, follow these steps: 

  1. Open Start.

  2. Search for gpedit and click the top result to open the Group Policy Editor.

  3. Open the following path:

    Computer Configuration > Windows Settings > Local Policies > Security Options
  4. Right-click the “Interactive logon: Machine inactivity limit” policy and choose the Properties option.

    Interactive logon: Machine inactivity limit

  5. Set the desired inactivity time in seconds (for example, 900 for 15 minutes).

    Lock PC automatically with Group Policy

  6. Click the Apply button.

  7. Click the OK button.

  8. Restart your computer.

Once you complete the steps, this policy forces the system to lock after the specified period of inactivity.

Lock your PC automatically after inactivity using Registry

To lock Windows 10 automatically after a period of inactivity, follow these steps: 

  1. Open Start.

  2. Search for regedit and click the top result to open the Group Policy Editor.

  3. Open the following path:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  4. Right-click in the System folder and select New, and choose “DWORD (32-bit) Value.”

    Create InactivityTimeoutSecs Registry key

  5. Confirm the InactivityTimeoutSecs as the name.

  6. Right-click the newly created key and choose the Modify option.

  7. Select the Decimal option.

  8. Set the desired inactivity time in seconds (for example, 900 for 15 minutes).

    Registry lock Windows 10 automatically

  9. Click the OK button.

  10. Restart your computer.

After you complete the steps, this method sets the inactivity timeout directly in the Registry.

Do you usually lock your computer before moving away from the screen? Let me know in the comments.

Update June 4, 2025: This guide has been updated to ensure accuracy and reflect changes to the process.

About the author

Mauro Huculak is a Windows How-To Expert and founder of (est. 2010). With over 21 years as a technology writer and IT Specialist, Mauro specializes in Windows, software, and cross-platform systems such as Linux, Android, and macOS.

Certifications: Microsoft Certified Solutions Associate (MCSA), Cisco Certified Network Professional (CCNP), VMware Certified Professional (VCP), and CompTIA A+ and Network+.

Mauro is a recognized Microsoft MVP and has also been a long-time contributor to Windows Central.

You can follow him on YouTube, Threads, BlueSky, X (Twitter), LinkedIn and About.me. Email him at [email protected].