How to Lock a File in Windows 10 — All Methods Explained

From built-in NTFS permissions and EFS encryption to dedicated third-party vaults, discover the safest ways to password-protect your sensitive files locally or on a shared network.

Editorial Team Updated Last Month 12 min read
What people search for (TL;DR) To truly lock a file in Windows 10 with a password, the OS built-in Encrypting File System (EFS) ties protection to your Windows user account—preventing other accounts from opening it. However, if you need a distinct password prompt every time you click a file or folder, Windows 10 cannot do this natively. You must use dedicated folder lock software (like Folder Lock) or compress the file into a password-protected ZIP archive.
Folder Lock 10 Security and Protection Promotional Banner

Guide Contents

Requirements & Compatibility Check

Before attempting to lock a file in Windows, you must verify your specific edition. Features like EFS and BitLocker are artificially restricted by Microsoft based on your license tier.

Windows 10 Capability Checker
Windows compatibility dashboard for checking file locking and encryption support

Understanding the Scope of File Security

A common mistake when searching for how to lock a file on my computer is confusing different layers of security. In Windows 10, protection operates at three distinct levels:

Digital data protection vault representing file and folder security layers

Method 1: Native Windows 10 Tools (No Software)

If you don't want to install third-party apps, you can use built-in Windows features. Be aware that these methods are often cumbersome and lack a dedicated password prompt mechanism.

Windows security tools interface for built-in file protection features

A. Encrypting File System (EFS)

Difficulty:

EFS encrypts your file using an encryption certificate tied to your Windows user account. If another user logs into the same PC, the file will appear green (or display a lock icon) and deny them access.

  1. Right-click the file you wish to secure and select Properties.
  2. In the General tab, click the Advanced button.
  3. Check the box labeled Encrypt contents to secure data.
  4. Click OK, then Apply.
  5. Windows will ask if you want to encrypt the file only, or the parent folder as well. Choose your preference.
Encryption explainer illustration for securing Windows files with EFS

Limitation: If you share a single Windows login account with your family, EFS is completely ineffective. The file will open normally for anyone using your account.

B. Folder Lock via CMD Batch Script (Basic Hiding)

Difficulty:

You can create a simple batch script that hides a folder and requires a text password to unhide it. This is a neat trick, but it is not true encryption. Anyone who right-clicks the `.bat` file and selects "Edit" can read your password in plain text.

Computer keyboard used for creating a Windows folder lock batch script

Copy the following code into Notepad, replace YOUR-PASSWORD-HERE with your desired password, and save the file as Locker.bat (ensure "All Files" is selected in the Save dialog).

cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder? (Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Private "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%==YOUR-PASSWORD-HERE goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End

C. Deny NTFS Permissions (Prevent Editing/Deletion)

Difficulty:

If you specifically searched for how to lock a file from being deleted or lock a file from being edited, NTFS permissions are the correct built-in tool.

  1. Right-click the file and select Properties > Security tab.
  2. Click Edit... to change permissions.
  3. Select the User or Group you want to restrict (e.g., "Everyone" or "Guest").
  4. Under the "Deny" column, check boxes for Modify, Write, and Delete (you may need Advanced settings for granular delete permissions).
  5. Click Apply.
Blocked access illustration for Windows NTFS permission restrictions

Method 2: Dedicated File Lock Software

Because Windows 10 lacks a native right-click "Password Protect" option, third-party software is the only way to get a true, on-demand lock prompt. This is vital if you share a PC and cannot rely on separate user accounts.

Folder Lock 10 main screen showing secure locker management on Windows

A. Full AES-256 Encryption & Portable Vaults

Difficulty:

Instead of just hiding a directory, premium tools scramble the binary data of your files using military-grade cryptographic standards. This guarantees that even if a thief physically removes your hard drive and bypasses the Windows 10 operating system entirely, the data remains unreadable.

Folder Lock AES-256 encrypted locker dashboard in Windows 10

Furthermore, modern security tools allow you to construct self-contained, executable vaults directly onto external flash drives. This means you can secure your data on your Windows 10 desktop, carry the USB stick to a different computer, and authenticate your password without needing to reinstall the software on the guest machine.

Secure virtual drive concept for portable encrypted file vaults

B. Granular Rule-Based Restrictions & File Masking

Difficulty:

Sometimes you do not need heavy encryption; you simply need to enforce strict boundaries. Advanced third-party utilities exist that allow you to dictate exact permissions. For example, you can set a policy that permits a coworker to view a spreadsheet but completely blocks them from altering or deleting it.

Folder Protect interface showing granular rule-based file and extension restrictions

Additionally, specialized tools offer "mask" protection. Instead of targeting a single folder, you can instruct the software to lock every single image format or application executable across your entire hard drive simultaneously.

C. Post-Lock Data Sanitization & Stealth

Difficulty:

A critical flaw in manual hiding methods is that Windows 10 retains a memory of recently opened documents. Dedicated software actively combats this by wiping your system's recent file history and permanently shredding the original, unprotected source files once they are moved into the secure vault. This prevents forensic recovery of the leftover unsecured copy.

Stealth mode operation concept for wiping traces after files are locked

Built-in Windows 10 Tools

  • Free (already installed)
  • No actual password prompt on files
  • Requires Win 10 Pro for EFS
  • Fails if PC is shared on one account
  • Can be complex to configure securely

Folder Lock Software

  • Instant locking mechanism
  • True password prompts per folder
  • Military-grade 256-bit AES encryption
  • Works across Windows editions
  • Includes file shredding and history cleaning
Military-grade file shield illustration comparing built-in tools with dedicated lock software

The Tool We Recommend for Most Users

Of all the methods we tested, Folder Lock provides the most resilient defense. It seamlessly blends rapid folder hiding with unbreakable cryptographic vaults, while offering synchronization across your desktop and mobile ecosystems.

Proactive Data Security Dashboard in Folder Lock 10
Folder Lock 10 Pro product boxshot for Windows file security

Free trials typically cap secure storage at 1GB. Upgrading to a premium license unlocks unlimited vault capacity and multi-device cloud syncing.

Troubleshooting & Verification

Security is only effective if applied correctly. Use these steps to verify your locked file is actually protected.

Post-Lock Verification Audit
Monitoring access attempts after verifying locked Windows files

Owner-Safe Recovery: Forgot Password

If you used EFS, and you reinstall Windows or lose access to your user account profile, your files may become permanently inaccessible unless you backed up the EFS certificate. Always export the certificate using the certmgr.msc tool.

If you used Folder Lock, locate your original master password, or check the settings for your registered recovery email if enabled. Legitimate security software does not include backdoor bypass tools—if it did, it wouldn't be secure.

Password lock graphic for owner-safe folder lock recovery planning

Windows 10 End-of-Life Security Implications

Microsoft officially ends support for Windows 10 on October 14, 2025. After this date, the OS will no longer receive security patches.

Calculating EOL...

Running an unsupported OS means any zero-day exploit could bypass built-in OS-level protections. If you plan to keep using Windows 10 after EOL, robust third-party encryption becomes significantly more important for sensitive files.

Laptop security upgrade concept for Windows 10 end of life protection

Frequently Asked Questions

Security shield protecting frequently asked file lock questions
How do I lock a file in Windows 10?
You can use the built-in Encrypting File System (EFS) if you have Windows 10 Pro, use third-party folder lock software, or place the file inside a password-protected ZIP archive.
How to lock a file so it cannot be deleted in Windows 10?
Right-click the file > Properties > Security. Edit permissions for the target user and explicitly deny the "Delete" and "Modify" permissions.
Can I lock a file from being edited in Windows 10?
Yes. In the Security properties, you can deny the "Write" permission while allowing "Read". This makes the file read-only for that specific user.
What is the difference between locking and encrypting a file in Windows 10?
Locking a file usually refers to denying access or requiring a password to open it via the OS interface. Encrypting (like BitLocker or EFS) scrambles the actual binary data of the file so it cannot be read even if the storage drive is removed and plugged into another computer.
How do I check which files are locked in Windows 10?
For system file locks (e.g., "File in Use"), you can use Resource Monitor > CPU tab > Associated Handles, and search for the file name. For encrypted files, you can open CMD and use the `cipher /s:C:\` command to list EFS protected files.
Is Folder Lock software compatible with Windows 11?
Yes, modern versions of Folder Lock are fully compatible with both Windows 10 and Windows 11, across all editions (Home, Pro, and Enterprise).
Can I take my locked files to another computer?
Yes. Advanced tools allow you to convert your secure directories into portable executable vaults. You can save these to a thumb drive and access your data on any other Windows machine by simply entering your master password, without requiring an administrative installation on the host PC.
Are there storage limits on free file locking tools?
Typically, yes. While some basic hiding scripts are free, robust encryption tools usually restrict trial users to a specific data cap (such as one gigabyte) or limit the number of vaults until you purchase a license.

Other Security Tools You Might Find Useful

These tools are developed by NewSoftwares.net, the same security team behind Folder Lock.

USB Secure portable password protection interface

USB Secure

Portable password protection for USB flash drives and external hard drives. Runs directly from the drive without requiring installation on the host PC.

Cloud Secure product boxshot for protecting cloud sync folders

Cloud Secure

Locks your local Dropbox, Google Drive, and OneDrive sync folders to prevent unauthorized access on your physical machine.