Operating system

Published on April 8th, 2021 | by Bibhuranjan


How to Password-Protect Files on Windows 10

We live in a time where data theft is very common so it becomes very important that all your sensitive data is safe at its best. Chances are your relative or friend asking to borrow your PC for some time and you are worried about your Private data and want to keep it secure. Obviously, you can spend money on some highly-priced third-party program to keep your files and folder safe. But we suggest there is a way where you will get the same security level without spending a single penny. A lot of users are not well aware but your Windows 10 has already some great tools and features that can protect your data. Want to know how to Password-Protect Files on Windows 10 then this guide has everything that you will ever need.

(WAYS) How to Password-Protect Files on Windows 10

So to protect your files and folders we have presented 3 different ways. All of these ways are pretty reliable and easy to use. Follow each step and by the end of the last step, you will know the complete working of the method.

The Batch File Method

In this method, we will be manually creating a batch file that will contain a certain code. This particular protects the file with a password of your choice and keeps it invisible and password protected. So no one can know if there is even a folder there, however, to access the contents of the folder you need to run the batch file then enter the password.

Once the password is entered you can access the content of the folder. The method might look hefty at first but once you go through it, you will not need the steps again. So let’s get started.

Suppose we have a folder called Photos inside the folder we have two image files and our aim is to protect the files with a password.

  • STEP 1. First of all, go inside the Photos folder; here we have our two image files
  • STEP 2. Now at any empty space right click and choose Create > Text Document
  • STEP 3. Open up the text file and paste the code mentioned just below


title Folder Locker

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



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.



ren Locker “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”

attrib +h +s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”

echo Folder locked

goto End


echo Enter password to Unlock folder

set/p “pass=>”

if NOT %pass%== ENTER 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


echo Invalid password

goto end


md Locker

echo Locker created successfully

goto End


  • STEP 4. Now that you have entered the code, head to the 22nd line of the code
  • STEP 5. Replace ENTER PASSWORD with a password of your choice

NOTE: Make sure to enter the password carefully; in the future, this password is what will unlock the contents of the folder.

  • STEP 6. Now that you have entered the password, go to the top left and click on File > Save as
  • STEP 7. Here make sure to replace the .txt extension with .bat after that put Save as file to All files
  • STEP 8. Now you will see that a Batch file has been created, at this point you can delete the text file
  • STEP 9. Double click on the Batch file and instantly a Folder will be created by the name Locker
  • STEP 10. Now move all the files that you want to password protect into the Locker folder, for e.g.: here we have two image files
  • STEP 11. Once the files have been moved, double click on the Batch file once again
  • STEP 12. You will see that a CMD window is opened up, which asks “Are you sure u want to Lock the folder (Y/N)”
  • STEP 13. Make sure to enter Y. After that command window will close itself and the Locker folder will vanish
  • STEP 14. To access your files double click on the batch file then enter your password and now you can access the contents of the folder

The Bitlocker Method

The BitLocker method is very famous, this service is available since Windows 7 and one of the most reliable ways to protect your data. If you have never tried the BitLocker method then there is one thing that must know and that is this method is only applicable to Drives only. You cannot apply the BitLocker method to a particular file or folder.

  • STEP 1. Head to My Computer, and right-click on the Drive you want to apply the Bitlocker
  • STEP 2. From the context menu choose Turn on BitLocker
  • STEP 3. A window will pop up that will ask you whether you want to put the Password Protection or Smart Card
  • STEP 4. It is suggested that you choose Password after the enter desired Password and then you will be asked to save a Recovery key
  • STEP 5. Make sure to save the Recovery key to a safe location as this will help in windows 10 password reset in case you forget the Password
  • STEP 5. If your drive has lots of data then it can take some time and make sure that you do not turn off your PC while this process is going on
  • STEP 6. Once the process is finished your drive and the files inside will completely be protected

The Encryption Method

In this method, we will be using the Windows 10 inbuilt encryption feature. Most of the users are not aware of this feature of windows. To see how it works let’s go through the steps.

As above here also suppose we have a folder called Photos inside the folder we have two image files and our aim is to protect the files with a password.

  • STEP 1. Once you are at the location where the Photos folder is located, right-click on the Photos folder and choose Properties
  • STEP 2. While you are in the General tab; at the bottom right click on the Advanced button
  • STEP 3. A small window will pop up at the bottom tick mark on Encrypt contents to secure data then click OK
  • STEP 4. Close Advanced window; assuming now you are on the Properties window at the bottom right click on the Apply button
  • STEP 6. A pop will appear that asks whether you want to apply the encryption to the Folder only or the files inside the folder as well choose your desired option
  • STEP 7. Quickly after that, you will be prompted to back-up your encryption key and certificate
  • STEP 8. Here save the encryption to some safe place; after that Certificate Export Wizard will begin you can choose the desired encryption format
  • STEP 9. It is suggested that you choose Personal Information Exchange then click Next
  • STEP 10. In this window, you can choose to password-protect the Certificate then click Next
  • STEP 11. Choose the location where you want to export the certificate and you are done

Wrapping Up

Protecting sensitive and private data is something that a lot of users struggle with. Most of us rely on freeware protection programs that are not that trustworthy. The above guide talks about three ways that can protect your personal files without using any freeware programs. All the ways are the feature of Windows 10 and above all reliable.

Hopefully, the guide clears your query. Thank you!

Tags: , , , ,

About the Author

Avatar photo

Editorial Officer, technofaq.org I'm an avid tech enthusiast at heart. I like to mug up on new and exciting developments on science and tech and have a deep love for PC gaming. Other hobbies include writing blog posts, music and DIY projects.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to Top ↑