How to create a password protected folder in windows 10

How to create a password protected folder in windows 10

  • To password protect a folder in Windows 10, you'll need to open the folder's "Properties" menu.
  • There's no way to recover a folder's password if you forget it, so make sure you write the password down somewhere.
  • Before you password protect a folder, you should copy the files within to an external hard drive or other source, so you can still access them if you lose the password.
  • You can only password protect folders in the Pro version of Windows 10 — it's not available in Windows 10 Home.
  • Visit Business Insider's Tech Reference for more stories.

In nearly all cases, you can only access folders on a Windows computer once you're logged into your user account. But if multiple people use the same account on your computer — maybe you share it with your family — this leaves your folders open for snooping.

There's dozens of apps that let you encrypt your folders. But luckily, Windows offers its own built-in options for password protecting folders.

It's totally free and easy to password protect a folder in Windows. However, there are a few downsides.

The first is that you need to be running Windows 10 Pro — Home version won't let you. The second is that once you set the password, there's no way to recover it if you forget it.

Here's how to password protect a folder on your PC.

Check out the products mentioned in this article:

Acer Chromebook 15 (From $179.99 at Walmart)

How to password protect a folder in Windows

1. Open Windows Explorer and find the folder you want to password protect, and then right-click on it.

2. Select "Properties."

You need to select this option from the pop-up window that appears. Melanie Weir/Business Insider

3. Click "Advanced."

You can find this option at the bottom right of the new dialog box. Melanie Weir/Business Insider

4. At the bottom of the Advanced Attributes menu that appears, check the box labeled "Encrypt contents to secure data."

You can also compress your folder to reduce its size while encrypting it. Melanie Weir/Business Insider

5. Click "OK."

6. Upon returning to the main window, click "Apply."

7. On the "Confirm Attribute Changes" window, choose between "Apply changes to this folder only" or "Apply changes to this folder, subfolders and files." 

You can encrypt only the main folder or the subfolders and files contained within it. Melanie Weir/Business Insider

8. Select "OK."  

9. A notification prompting you to back up your file encryption key will appear. Click "Backup now."

10. Insert a USB flash drive to your computer, and follow the on-screen instructions to create your encryption certificate and export to the USB drive.

Note: The final step is optional, but if you skip it, you run the risk of losing access to your encrypted files.

  • 7 easy ways to speed up your Windows 10 computer, from disabling unneeded effects to upgrading your hardware

  • How to take a screenshot on Windows 10 computers in several different ways

  • How to change the size of your desktop icons on a Windows 10 computer

  • How to create a guest account on your Windows 10 computer in 6 steps

  • 5 ways to save battery on any Windows laptop and keep your computer running longer

Melanie Weir

Freelance author

Melanie Weir is a freelance author for Insider, mainly focusing on the Tech Reference section, but occasionally contributing to Lifestyle and Entertainment topics as well. She is also a freelance writer for ScreenRant, and is the Lead Weekend News Editor at TheThings.com. In her spare time she writes plays for both stage and screen. She can be reached at , or through LinkedIn.

Read more Read less

Insider Inc. receives a commission when you buy through our links.

  1. Home
  2. How-to
  3. Computers

A Windows 11 laptop on a desk

(Image credit: Wachiwit / Shutterstock)

Once you know how to password protect folders on Windows, you'll be able to keep all your files safe and secure from prying eyes.

Whether you're running Windows 11 or Windows 10, there's a way to protect any folder by adding a password to it, which is handy if you have some particularly sensitive files on your PC.

This method involves creating a special folder that will "disappear" instantly, requiring a password to be entered to show it again. Granted, it's quite a fiddly process and not as secure as encrypting your files using Microsoft's Bitlocker tool. But unlike Bitlocker, this method should work on any version of Windows 10 or 11, so you're covered even if you don't have one of the best laptops.

It's worth noting that you should test this method out on a dummy folder first, in case things don't go to plan and you end up losing access to your precious files. It's also worth mentioning that if you need more robust protection, you should check out our guide on how to encrypt files on Windows 10.

So, if you want to know how to password protect folders on Windows, follow our guide below.

Note: The screenshots in this guide were taken on Windows 11, though the steps are the same for Windows 10.

How to password protect folders on Windows

1. Open the folder you want to protect in File Explorer and right-click in an empty space inside it. Next, hover over New, then click Text Document.

How to password protect folders on Windows

(Image credit: Future)

2. Windows wants you to name this text document, but there's no need, as we won't need it for anything else in the later steps. So, simply press enter/return to give this file the default name of New Text Document.

How to password protect folders on Windows

(Image credit: Future)

3. Double-click your newly-created text file to open it.

How to password protect folders on Windows

(Image credit: Future)

4. Next, copy and paste the text below exactly as it appears into your text file.

cls

@ECHO OFF

title Folder Locker

if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK

if NOT EXIST Locker goto MDLOCKER

:CONFIRM

echo Are you sure you want to lock the folder? (Y for yes or N for no)

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 Locker "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 the 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}" Locker

echo Folder unlocked successfully

goto End

:FAIL

echo Invalid password

goto end

:MDLOCKER

md Locker

echo Locker created successfully

goto End

:End

How to password protect folders on Windows

(Image credit: Future)

5. You should now see the pasted text inside your file. Locate the line that says "if NOT %pass%==Your-Password-Here" and replace the text "Your-Password-Here" with the password you want to use to lock your folder. For example, if your chosen password is "password123", the line should read "if NOT %pass%==password123".

Note: Make sure you use a password you'll remember, as you may lose access to your hidden folder if you forget it. It's also best to not use any spaces in your password, as this may cause errors.

How to password protect folders on Windows

(Image credit: Future)

6. Now we need to turn this bunch of text into a folder locking tool. To do this, click File then select Save As...

How to password protect folders on Windows

(Image credit: Future)

7. Click Text documents in the Save as type field, then click All files.

How to password protect folders on Windows

(Image credit: Future)

8. In the File name field, enter FolderLocker.bat then click Save.

How to password protect folders on Windows

(Image credit: Future)

9. You should now see the FolderLockerfile appear inside your folder. Double-click the FolderLocker file and the Locker folder will appear. You can now delete the New Text Document file if you wish, since it's no longer needed.

How to password protect folders on Windows

(Image credit: Future)

10. The Locker folder is the place where you can hide anything you want to be hidden and password-protected. Place any files you wish to protect inside the Locker folder, by either dragging the files or pasting them into the folder.

How to password protect folders on Windows

(Image credit: Future)

11. Now for the fun part. To hide your Locker folder and protect it with the password you chose earlier, double-click the FolderLocker file inside the folder.

How to password protect folders on Windows

(Image credit: Future)

12. On the prompt that appears, type "Y" then press enter/return.

How to password protect folders on Windows

(Image credit: Future)

13. Your Locker folder should now disappear, protecting its contents along with it. To make the Locker folder and its contents reappear, double-click the FolderLocker tool.

How to password protect folders on Windows

(Image credit: Future)

14. In the prompt that appears, input the password you chose earlier, then hit enter/return.

How to password protect folders on Windows

(Image credit: Future)

15. Your Locker folder and its contents should now reappear. To hide your Locker folder again, simply double-click the FolderLocker file and input Y,then hit enter/return in the prompt, just like before.

Now you know how to password protect folders on Windows, make sure to check out some more of our Windows guides, including how to type emoji on Windows, how to change the Windows 11 Start menu back to Windows 10, how to install Android apps on Windows 11 and how to enable clipboard history on Windows. If you'd like to shore up your Apple computer's security, read our guides on how to password protect folders on Mac, how to password protect a PDF on Mac and how to encrypt files on Mac.

Get instant access to breaking news, the hottest reviews, great deals and helpful tips.

Dale Fox is a freelance journalist based in the UK. He's been a tech nerd ever since childhood, when he used the money from his first job as a paperboy to buy a subscription to GamesMaster magazine. Dale was previously a presenter and editor in China, where he also worked as a copywriter for OnePlus at its Shenzhen HQ.