How to Lock Your Windows 10 PC Using Command Prompt (2024)

Windows 10

How to Lock Your Windows 10 PC Using Command Prompt (1)

Updated

Your changes have been saved

Email is sent

Email has already been sent

Please verify your email address.

You’ve reached your account maximum for followed topics.

Manage Your List

Link copied to clipboard

Sign in to your How-To Geek account

How to Lock Your Windows 10 PC Using Command Prompt (2)

Quick Links

  • Lock Your Windows 10 PC Using Command Prompt

  • Set the Lock Screen Timeout Setting Using Command Prompt

Key Takeaways

  • To lock your Windows PC using Command Prompt, run "Rundll32.exe user32.dll,LockWorkStation" in the Command Prompt
  • To set the lock screen timeout, run "powercfg.exe /SETACVALUEINDEX SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK <time>" in Command Prompt as Admin
  • Activate the lock screen timeout setting by running "powercfg.exe /SETACTIVE SCHEME_CURRENT" after you set the timeout.

One of the first rules of cyber security is to always lock your PC before stepping away. While it may not be the quickest way to lock your Windows 10 PC, you can do it using the Command Prompt.

Lock Your Windows 10 PC Using Command Prompt

First, open the Command Prompt on your PC by opening the Start menu, typing “cmd” in the Windows Search bar, and then selecting “Command Prompt” from the search results.

How to Lock Your Windows 10 PC Using Command Prompt (3)

Command Prompt will now open. Here, run this command to lock your Windows 10 PC.

Rundll32.exe user32.dll,LockWorkStation
How to Lock Your Windows 10 PC Using Command Prompt (4)

Once executed, your PC will be locked. You'll have to sign back in with your PIN, password, or whatever sign-in method you usually use.

Set the Lock Screen Timeout Setting Using Command Prompt

Once you’ve locked your PC, the lock screen will generally be displayed for a certain amount of time before it time outs. You can set the amount of time that needs to pass before timing out using the Command Prompt.

To do this, you’ll need to open Command Prompt as an admin. Do so by typing “cmd” in the Windows Search bar and then right-clicking “Command Prompt” from the results. Next, select “Run As Administrator” from the menu that appears.

How to Lock Your Windows 10 PC Using Command Prompt (5)

With Command Prompt open, run this command.

powercfg.exe /SETACVALUEINDEX SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK <time>

Replace <time> with your desired amount of time in seconds. That means if you want to time out the lock screen after two minutes, you’d enter this command:

powercfg.exe /SETACVALUEINDEX SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK 120
How to Lock Your Windows 10 PC Using Command Prompt (6)

This command sets the lock screen timeout setting for your PC if it’s plugged in to a power source. To set the lock screen timeout setting for your PC if it’s running on battery, change/SETACVALUEINDEX to/SETDCVALUEINDEX and run the command as normal.

Next, run this command:

powercfg.exe /SETACTIVE SCHEME_CURRENT
How to Lock Your Windows 10 PC Using Command Prompt (7)

Now your lock screen will timeout after the set amount of time. Give it a try!

Your changes have been saved

Email is sent

Email has already been sent

Please verify your email address.

You’ve reached your account maximum for followed topics.

Manage Your List

Follow

Followed

Follow with Notifications

Follow

Unfollow

Readers like you help support How-To Geek. When you make a purchase using links on our site, we may earn an affiliate commission. Read More.

How to Lock Your Windows 10 PC Using Command Prompt (2024)
Top Articles
How to Use Google Sheets as a Database | Coupler.io Blog
Convert 1 BNB to USD - Binance Coin price in USD | CoinCodex
Best Pizza Novato
Places 5 Hours Away From Me
Devon Lannigan Obituary
50 Meowbahh Fun Facts: Net Worth, Age, Birthday, Face Reveal, YouTube Earnings, Girlfriend, Doxxed, Discord, Fanart, TikTok, Instagram, Etc
Nc Maxpreps
Natureza e Qualidade de Produtos - Gestão da Qualidade
Lantana Blocc Compton Crips
What Does Dwb Mean In Instagram
Hmr Properties
Athens Bucket List: 20 Best Things to Do in Athens, Greece
Operation Cleanup Schedule Fresno Ca
Xxn Abbreviation List 2023
Dignity Nfuse
Missed Connections Inland Empire
Hobby Stores Near Me Now
All Breed Database
Craigslist Battle Ground Washington
How to Watch Every NFL Football Game on a Streaming Service
European Wax Center Toms River Reviews
When His Eyes Opened Chapter 3123
Stephanie Bowe Downey Ca
Uncovering the Enigmatic Trish Stratus: From Net Worth to Personal Life
Sinai Sdn 2023
Grays Anatomy Wiki
Ravens 24X7 Forum
Mobile Maher Terminal
Utexas Baseball Schedule 2023
Ultra Clear Epoxy Instructions
1987 Monte Carlo Ss For Sale Craigslist
Whitehall Preparatory And Fitness Academy Calendar
Skyrim:Elder Knowledge - The Unofficial Elder Scrolls Pages (UESP)
Scanning the Airwaves
Dadeclerk
Download Diablo 2 From Blizzard
1Exquisitetaste
Sarahbustani Boobs
Powerspec G512
2024-09-13 | Iveda Solutions, Inc. Announces Reverse Stock Split to be Effective September 17, 2024; Publicly Traded Warrant Adjustment | NDAQ:IVDA | Press Release
Nu Carnival Scenes
Unlock The Secrets Of "Skip The Game" Greensboro North Carolina
Copd Active Learning Template
Maplestar Kemono
Pas Bcbs Prefix
Wera13X
ESPN's New Standalone Streaming Service Will Be Available Through Disney+ In 2025
Kenmore Coldspot Model 106 Light Bulb Replacement
Compete My Workforce
Deviantart Rwby
Yoshidakins
Latest Posts
Article information

Author: Domingo Moore

Last Updated:

Views: 6587

Rating: 4.2 / 5 (53 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Domingo Moore

Birthday: 1997-05-20

Address: 6485 Kohler Route, Antonioton, VT 77375-0299

Phone: +3213869077934

Job: Sales Analyst

Hobby: Kayaking, Roller skating, Cabaret, Rugby, Homebrewing, Creative writing, amateur radio

Introduction: My name is Domingo Moore, I am a attractive, gorgeous, funny, jolly, spotless, nice, fantastic person who loves writing and wants to share my knowledge and understanding with you.