While Windows does not have a built-in "password lock" feature for folders, there are some clever workarounds to protect your private files and add an extra layer of security. Here are some effective options to try.

How to Password Protect a Folder in Windows 2024

1. Lock the Folder Using a Batch File

If you are not keen on using third-party apps and programs, creating a batch script is perhaps the best way to lock folders with a password of your choice. Here's how to do it.
  1. Locate the folder you'd like to lock and open it.
  2. Right-click on an empty space within the File Explorer window and select New > Text Document.
  3. In the text document, copy and paste the following code:                                               @ECHO OFF
    if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
    if NOT EXIST Private goto MDPrivate
    :CONFIRM
    echo Are you sure to lock this 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 Your Secure Folder
    set/p "pass=>"
    if NOT %pass%==your_password 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
    :MDPrivate
    md Private
    echo Private created successfully
    goto End
    :End
  4. In the text file, replace your_password in the line if NOT "%pass%==your_password" goto FAIL to a password of your choice.
  5. Click the File menu at the top and select Save As.
  6. Give any name to the file and add the .bat extension at the end.
  7. Select All Files under the Save as type dropdown menu and hit Save.
  8. Double-click the BAT file to run it. This will create a new folder named Private in the same directory.
  9. Move all the files and folders you want to lock into the Private folder.
  10. Double-click your batch file again once you've placed your files in the Private folder.
  11. In the command prompt window, input Y and press Enter.                                                        

Your folder should now disappear. To access it later, double-click the batch file and enter the password you set earlier. If you enter your password correctly, the private folder will reappear.

2. Lock the Folder Using 7-Zip

Another way to secure and compress your sensitive documents on Windows is by utilizing a popular desktop program called 7-Zip. Primarily used for unzipping folders and extracting files, 7-Zip also lets you password-protect folders. Here's how to use it:
  1. Download and install 7-Zip on your PC.
  2. Open the 7-Zip File Manager app using the search menu.
  3. Locate the file or folder you want to protect, select it, and click the Add option at the top of the window.
  4. Select the Delete file after compression checkbox.
  5. Enter your new password in the Encryption section and click OK.
Once you complete the steps above, your folder will be replaced by a ZIP file. To access its content, right-click your ZIP file and select 7-Zip > Extract Here. You'll then be prompted to enter your password.

While this method isn't particularly efficient, as you'll need to go through the entire process every time you need to add files, it works perfectly and relies solely on trusted software.

3. Use the Folder Lock App

You can always install a third-party tool for added convenience or advanced features. Numerous good programs are available to lock folders on Windows. One such option is Folder Lock, which enables you to protect files and folders and allows you to lock your USB or external storage drives.

Once the targeted folder is locked, you'll need to use the Folder Lock app to unlock it. This tool is free, but you can upgrade to the Pro version if you want to access its premium features.

Bonus Tip: Hide Sensitive Files and Folders on Windows

While Windows does not have a feature to lock folders with a password, it does provide the option to hide them. By changing the folder's properties to "hidden," you can make it invisible in File Explorer.

To do this, simply right-click a file or folder and select Properties. Then, check the Hidden option under Attributes and click Apply.

Your file or folder should now disappear. To view your folder again, you will need to configure Windows to show hidden files and folders. You can do this by opening File Explorer Options and selecting the Show Hidden Files, Folders, and Drives checkbox under the View tab. To hide your files again, head to your File Explorer Options window and select Don't Show Hidden Files, Folders, or Drives. That's it!

So, these are some of the best options to protect your sensitive folders on Windows. No matter which method you choose, you can be assured that your sensitive documents will be safeguarded under an additional layer of protection that's not available by default on your PC.