WATCH FULL VIDEO BELOW
Tech

How to Password-Protect a Folder in Windows

Most of us have files on our computers that we’d rather keep private. If you use a shared computer, ensuring that others stay away from your sensitive folders might be easier said than done, though. Even if each user has a unique profile with private information, they might find their way to your files. One way to ensure they can’t actually access them is by password-protecting the folder in question.

How to Password-Protect a Folder in Windows

Although password protection is a key security feature, not every version of Windows provides a hassle-free way for users to keep their files safe. Nevertheless, where there’s a will, there’s a way. Here’s how to password-protect a folder in Windows 11, 10, and 7 using various methods.

Before You Begin

Before making any tweaks using the instructions below, create a backup of your important files. Save your folder to an external drive or simply make a copy of the files on your PC and delete them once you’ve confirmed that the encryption was successful. The last thing you want is to get locked out of your own folder by mistyping a password.

How to Password-Protect a Folder in Windows 11

Windows’s newest version requires users to create a profile to use the operating system. The process also involves the creation of a password. Since this password will always be required to access the profile, files stored on the PC are assumed to be safe from other users.

Since your account is already password-protected, Windows 11 doesn’t offer a dedicated password-protection feature for files or folders. This can be a problem if you leave the computer turned on and logged in while you’re away and let other people access it.

Fortunately, there are still a few ways to ensure no one will barge in on your private folder. Read about them below.

Use BitLocker

A great way to secure folders you want to keep private utilizes two Windows 11 features: virtual drives and BitLocker. You’ll need to create a virtual drive to serve as a folder and then add a layer of protection to it using BitLocker. This is a more secure solution than simply editing folder properties.

BitLocker is available on Windows 11 Pro, Enterprise, and Education editions. If you have Windows 11 Home, you may want to skip to the next section for a different solution.

To create a virtual drive on Windows 11, follow these steps:

  1. Click on the Start menu and search for “Disk Management.”
    How to Password Protect a Folder in Windows 11 1
  2. Select the first result.
    How to Password Protect a Folder in Windows 11 2
  3. Find “Action” in the menu bar at the top.
    How to Password Protect a Folder in Windows 11 3
  4. Click on “Create VHD” to start the virtual drive setup process.
    How to Password Protect a Folder in Windows 11 4
  5. Select a location for your VHD using the “Browse” button.
    How to Password Protect a Folder in Windows 11 5
  6. Name your new virtual drive and click “Save.”
    How to Password Protect a Folder in Windows 11 6
  7. Determine the size of your VHD.
    How to Password Protect a Folder in Windows 11 7
  8. Select the format and disk type you prefer and click “OK.”
    How to Password Protect a Folder in Windows 11 8 1

It’s recommended that you pick “Dynamically Expanding” under disk type so your VHD can grow with you.

There are still a few steps you need to complete before you can start using your virtual drive:

  1. Still in the “Disk Management” window, right-click the VHD you just created.
    Use BitLocker 1
  2. Click on “Initialize Disk.”
    Use BitLocker 2
  3. Make sure your VHD is selected, and pick “GPT” for the partition style.
    Use BitLocker 3
  4. Press “OK” to close the window.
    Use BitLocker 4
  5. Right-click in the “Unallocated” area next to the VHD and select “New Simple Volume.”
    Use BitLocker 5
  6. Click on “Next” until the dialogue box asks you to assign the drive a letter.
    Use BitLocker 6
  7. Pick a letter and proceed with the “Next” button.
    Use BitLocker 7
  8. Format your partition with the following parameters:
    Use BitLocker 8
    • Select “NTFS” for “File system.”
    • Make sure “Allocation unit size” is “Default.”
    • Give the drive a descriptive name under “Volume label.”
    • Check “Perform a quick format.”
  9. Click on “Next,” then “Finish.” Your virtual drive can now be used just like any folder on your PC.
    Use BitLocker 9

Once you’ve created a VHD using the steps above, you can set up BitLocker for this drive. Here’s what you’ll need to do:

  1. Go to your Settings and select “System.”
    BitLocker 1
  2. Click on “Storage” in the right-side panel.
    BitLocker 2
  3. Scroll down to “Storage management” and expand “Advanced storage settings.”
    BitLocker 3
  4. Click on “Disks & volumes” and select your new virtual drive from the list.
    BitLocker 4
  5. Select “Properties” and find “Turn on BitLocker” near the bottom.
    BitLocker 5
  6. Click on the drive again under “Fixed data drives” and hit “Turn on BitLocker.”
    BitLocker 6
  7. Pick the password option in the dialogue box and create a password for your drive.
    BitLocker 7
  8. Hit “Next” and choose how you want to save the password.
    BitLocker 8
  9. Proceed with “Next” and select “Encrypt used disk space only.”
    BitLocker 9
  10. Pick “Compatible mode” on the next screen.
    BitLocker 10
  11. Start the encryption, then close the window.
    BitLocker 11

Your virtual drive is now password-protected.

Use a Zip Folder

Another way to password protect your private files is by adding them to a Zip archive. This is a great solution for files you don’t use often. In addition, you can use this method regardless of your Windows 11 edition. You’ll need 7-Zip or a similar file archiver app for this method.

  1. Download and install 7-Zip.
    Use a Zip Folder 1
  2. Navigate to the folder you want to password-protect.
    Use a Zip Folder 2
  3. Find 7-Zip on the list and select “Add to archive…” from the menu.
    Use a Zip Folder 3
  4. Make sure you pick “0 – Store” for “Compression level.”
    Use a Zip Folder 4
  5. Check the box next to “Delete files after compression” to let the app remove the original files.
    Use a Zip Folder 5
  6. Define your password in the “Encryption” section and make sure the encryption method is “AES-256.”
    Use a Zip Folder 6
  7. Click “OK,” and your password-protected Zip file is ready.+
    Use a Zip Folder 7

How to Password-Protect a Folder in Windows 10

Similarly to Windows 11, the Home edition of Windows 10 doesn’t offer folder encryption. If you have this OS version, you can try using a batch script to password-protect your folder instead. Adding your files to a compressed folder is also a secure way to store sensitive data. Users with Windows 10 Pro, Enterprise, or Education can create a virtual drive and enable BitLocker to protect it using the instructions detailed in the Windows 11 section.

Use a Batch Script

Even if your Windows 10 Home doesn’t let you password-protect files by editing their properties, you can create a script that will do so. Laptopmag shared a handy code, and all you’ll need to do is paste it into a text document. Although this method doesn’t provide advanced security — a tech-savvy individual might see right through it — it’s still helpful when you need to keep household members away from your files.

Follow the steps below to apply the script:

  1. Go to the folder you want to protect.
    Use a Batch Script 1
  2. Right-click inside the folder without selecting any file.
    Use a Batch Script 2
  3. Select “New,” then “Text Document.”
    Use a Batch Script 3
  4. Open the text file and paste the following code:
    Use a Batch Script 4
    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 u 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 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 folder
    set/p "pass=>"
    if NOT %pass%==YourPasswordHere 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
  5. Replace “YourPasswordHere” in the code with a custom password.
    Use a Batch Script 5
  6. Save the text file as “FolderLocker.bat” while making sure the file type is set to “All Files.”
    Use a Batch Script 6
  7. Double-click on your Folder Locker file and a new folder will appear.
    Use a Batch Script 7
  8. Drag all the files you want to hide in the Locker Folder.
    Use a Batch Script 8
  9. Double-click the batch file.
    Use a Batch Script 9
  10. Type “Y” and press Enter to lock the folder.
    Use a Batch Script 10

Whenever you want to access your folder, you’ll need to unlock it first. You can do so in the following way:

  1. Double-click on the Folder Locker batch file.
    unlock 1
  2. Enter your password and press Enter.
    unlock 2

The downside of this method is that you’ll need to lock and unlock the folder every time using the instructions above.

Archive Your Files

The batch script method does the job but isn’t the most secure. Another way to password-protect files is by adding them to a Zip archive. You can use WinRAR or a similar app for this method. We’ll use 7-Zip as an example:

  1. Download and Install 7-Zip on your Windows 10 PC.
    Archive Your Files 1
  2. Go to the folder you want to lock and right-click the folder.
    Archive Your Files 2 1
  3. Select 7-Zip, then “Add to archive…”
    Archive Your Files 3
  4. Make sure “Compression level” is set to “0 – Store.”
    Archive Your Files 4
  5. Check “Delete files after compression.”
    Archive Your Files 5
  6. Type a password and set the encryption method to “AES-256.”
    Archive Your Files 6
  7. Press “OK,” and your files are now safe in a password-protected archive.
    Archive Your Files 7

How to Password-Protect a Folder in Windows 7

Windows 7 makes password-protecting a folder a breeze. All you need to do is tweak the folder’s properties, and your files will be safe from the prying eyes of family members. With this method, you’ll need to enter your user profile’s password each time you want to access the folder’s contents. Although this method doesn’t let you create a new password, it’s still a useful solution when you don’t need advanced protection.

Follow the steps below to encrypt any folder on your Windows 7 device:

  1. Open the folder you want to password-protect.
  2. Right-click anywhere in the folder.
  3. Select “Properties” from the dropdown menu.
  4. In the “General” tab, find the “Advanced…” button.
    How to Password Protect a Folder in Windows 7 3
  5. Select “Encrypt content to secure data.”
    How to Password Protect a Folder in Windows 7 4
  6. Hit “OK,” and you’re done.
    How to Password Protect a Folder in Windows 7 5

Keep Your Files Secure

Be it for your financial documents, family photos, or simply some notes, you have every right to privacy. Use one of the methods mentioned above to password protect your folder and keep your files safe even when someone accesses your user profile. If none of the solutions suit your needs, you can always download a third-party app that offers more advanced features.

Which of these password-protection methods do you find the most convenient? Do you have any tips to share we haven’t covered above? Let us know in the comments section below.

Muhabarishaji

🧪 |Medical Laboratory Scientist 🥇 | Mindset over Everything. 
 🤝 | Let's Grow Together.

Related Articles

Back to top button