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.

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.

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:

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.

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.

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.
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.

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
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.

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.

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.
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.

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.
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.
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.


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.
Free trials typically cap secure storage at 1GB. Upgrading to a premium license unlocks unlimited vault capacity and multi-device cloud syncing.
Security is only effective if applied correctly. Use these steps to verify your locked file is actually protected.

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.

Microsoft officially ends support for Windows 10 on October 14, 2025. After this date, the OS will no longer receive security patches.
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.


These tools are developed by NewSoftwares.net, the same security team behind Folder Lock.
Portable password protection for USB flash drives and external hard drives. Runs directly from the drive without requiring installation on the host PC.

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