How to Lock Your PC Screen with a Password in Windows 10

To lock your Windows 10 PC with a password, first make sure your account has a password or PIN under Settings > Accounts > Sign-in options. Then press Windows key + L whenever you step away. The screen locks straight away, and nobody can get back in without your password or PIN. You can also make Windows lock itself after a few minutes of inactivity, or when your phone moves out of Bluetooth range. Here’s how to set up each one.

How to lock a Windows 10 PC with a password: set a password, press Windows+L, set automatic locking and use Dynamic lock
Set a password, then lock manually or automatically. This is a drawing, not a screenshot.

Note: Windows 10 reached end of support in October 2025. If you’re still using it, see how to enroll in Windows 10 Extended Security Updates to keep getting security fixes.

Step 1: Make sure your account has a password

Locking only protects your PC if there’s a password, PIN or other sign-in method. Without one, anyone can click Sign in and get straight back to your desktop.

  1. Press Windows + I to open Settings.
  2. Go to Accounts > Sign-in options.
  3. Under Password, click Add if you don’t have one. Enter a password and a hint, and click Finish.
  4. Optionally, set up a Windows Hello PIN under PIN. It’s quicker to type and only works on this PC.

If you sign in with a Microsoft account, your password already exists. To change your PIN later, see how to change your PIN in Windows 10.

Choose a good password or PIN

  • Passwords: Use at least 12 characters. A short phrase of unrelated words is easier to remember than random symbols, and just as hard to guess.
  • PINs: Avoid birthdays, 1234 and repeated digits. Windows lets you use longer PINs, and letters too, if you tick Include letters and symbols when you set one up.
  • Don’t reuse it. If you use a local account, don’t use the same password you use for email or banking.

Windows Hello face or fingerprint sign-in, if your PC supports it, is quicker still, and it unlocks the PC without anyone seeing you type.

Step 2: Lock your PC instantly

Use any of these methods:

  • Keyboard shortcut: Press Windows key + L. This is the fastest method.
  • Ctrl + Alt + Delete: Press the three keys together and choose Lock.
  • Start menu: Click Start, then your account picture, then Lock.

Your apps and documents stay open while the PC is locked. When you come back, sign in and everything will be where you left it.

Make a lock shortcut on the desktop

  1. Right-click the desktop and choose New > Shortcut.
  2. For the location, type rundll32.exe user32.dll,LockWorkStation and click Next.
  3. Name it Lock PC and click Finish.

Double-click the shortcut to lock. You can also right-click it and choose Pin to taskbar for one-click locking.

Step 3: Lock automatically when you’re inactive

If you often forget to lock, have Windows do it for you after a set time:

  1. Go to Settings > Personalization > Lock screen.
  2. Scroll down and click Screen saver settings.
  3. Choose any screen saver, or (None) if you don’t want one to show.
  4. Set Wait to the number of minutes you want, such as 5.
  5. Tick On resume, display logon screen and click OK.

After that many minutes of no mouse or keyboard activity, the PC locks.

Require a password after sleep

Go to Settings > Accounts > Sign-in options. Under Require sign-in, choose When PC wakes up from sleep. This makes sure that closing a laptop lid also locks it.

Step 4: Lock automatically when you walk away (Dynamic lock)

Dynamic lock uses your phone’s Bluetooth connection to tell when you’ve left.

  1. Pair your phone with the PC under Settings > Devices > Bluetooth & other devices.
  2. Go to Settings > Accounts > Sign-in options.
  3. Under Dynamic lock, tick Allow Windows to automatically lock your device when you’re away.

When your phone goes out of range, the PC locks about a minute later. It’s a backup, not a replacement for Windows + L, because someone could still use the PC in that minute.

Customize what the lock screen shows

You can change the lock screen background and choose which apps show notifications on it under Settings > Personalization > Lock screen. To hide notification previews from people walking past, turn off Show notifications on the lock screen under Settings > System > Notifications & actions. For more options, see how to change the login screen in Windows 10.

Troubleshooting

Windows + L doesn’t work

Some keyboards have a Windows key lock, often labeled as a gaming mode, that turns off the Windows key. Turn that mode off, or use Ctrl + Alt + Delete instead. On a work PC, an administrator may have changed this setting.

The PC locks but doesn’t ask for a password

Your account has no password. Add one as shown in Step 1.

I forgot my password

On the sign-in screen, click I forgot my password or I forgot my PIN and follow the prompts. Microsoft accounts can be reset online.

Frequently asked questions

Does locking close my programs?

No. Locking keeps everything running. Signing out closes your apps.

How do I stop Windows asking for a password?

You can, but it leaves the PC open to anyone nearby. See how to remove the lock screen password in Windows 10.

Is it the same in Windows 11?

Mostly. Windows + L works the same way, but some settings have moved. See how to put a password on the lock screen in Windows 11.

Summary

  1. Add a password or PIN in Settings > Accounts > Sign-in options.
  2. Press Windows + L to lock.
  3. Turn on On resume, display logon screen in the screen saver settings so the PC locks automatically.
  4. Turn on Dynamic lock if you carry a paired phone.

Get Our Free Newsletter

How-to guides and tech deals

You may opt out at any time.
Read our Privacy Policy