How to Password Protect a Folder or File on Windows PC

How to Password Protect a Folder or File on Windows PC

Have you ever been stuck in a situation wherein you simply can’t share your PC with your friends, colleagues, etc? Not letting others access your PC is of course the best to protect your personal data. However, there comes a time, when we reluctantly let our friends and relatives use our computers. Well, if you too have to take such difficult choices, you can always password-protect a folder or file in Windows 10.

Doing so, you don’t need to be rude each time someone asks for the PC. Rather, you might be able to share your device without worrying too much about your personal information.

Ways to password-protect a file or folder in Windows 10

There are three different ways to password-protect your sensitive data in Windows 10 which are Creating and Running a batch file, making the important folders hidden, or using the Windows BitLocker. Let’s explore these methods in detail –

1] Create and then Run Batch File

Users may password-protect their folder or file in Windows 10 by using a batch file. Creating a batch (BAT) file involves a series of steps that you must perform carefully. Overall, this is a simple yet lengthy procedure. Here are the essential steps to work upon –

Create a Batch File

  • First of all, create a file and name it whatever you have in your mind.
  • Make a right-click anywhere inside a folder (just remember its path) and select New > Text Document.
  • Next, double-click on the .txt file to open it, and paste the below set of codes –
password protect a folder or file in Windows 10
  • Next, press the “Ctrl + Shift + S” keys together to open the “Save as type” window.
  • Fill any name with a. bat extension inside the “Filename”, and change the “Save as type” section to “All Files” using the drop-down menu.
Save As type

Run the Batch File

Imp: If you have downloaded our file, right-click on the file, and click Edit. When this file opens up with notepad, go to the “ if NOT %pass%==your_password goto FAIL” line and replace your_password with your own password.

  • Now, open the folder containing the batch file. Subsequently, right-click on the batch file and hit Run as Administrator.
Run Batch file as Administrator
  • You will notice a new folder titled “Locker” appearing there. This now works as a locker for all your personal stuff – data, pictures, files, etc.
  • Just open this folder and place all the essential items here.
  • Double-click on the Batch file and this redirects you to the command prompt.
  • Press Y then Enter to lock the folder.
password protect a folder or file in Windows 10

That’s it, you will no longer see the “Locker” folder.

How to access the Locker folder

To re-open the locker folder, follow the below guideline –

  • Make a right-click on the batch file, type the “password you created” on the prompt, and hit Enter.
password protect a folder or file in Windows 10
  • If you have entered the correct password, you may see the locked folder once again.

2] Hide your Files/Folders

The above method is best suited for protecting personal data, pictures, folders, etc. However, at times, we just want to keep a few folders far from the reach of kids or others. If that’s the case, there’s no need to follow complex steps as guided above. Instead, you can hide the specific folders so that no one accesses them normally.

Here’s how to proceed –

  • Right-click on the specific folder and hit Properties.
  • On the Properties window, head over to the General tab.
  • Tick the checkbox left of Hidden under the Attributes section and hit Apply then OK. See the Snapshot below –
password protect a folder or file in Windows 10

In general, performing the above task hides the particular folder. However, if you are still able to view the hidden folders, this implies that Windows 10 is set to display hidden files or folders.

To set Windows not showing hidden files or folders, follow the below guideline –

  • Go back to the folder containing the hidden files/folders and click the View tab.
  • Next, hit Options and hit “Change folder and search options”.
password protect a folder or file in Windows 10
  • Go to the View tab on the succeeding Folder Options wizard, mark the radio button “Don’t show hidden files, folders, or drives”, and hit OK.
Don't show hidden files or folders
  • That’s it, you must not be able to view the hidden folders now.

3] Using Windows BitLocker

Windows BitLocker is an in-built tool on Windows 10 that helps to secure files and folders. However, it has its own limitations. First of all, this utility program is available only to Windows Pro and Enterprise versions only. In case you are using a Windows 10 Home version, you may skip this method. Moreover, this tool can’t lock a specific file or folder, rather this protects the entire disk drive.

If you meet the two conditions cited above, follow the below steps to encrypt any disk drive –

  • Jointly press Win+E to launch the File Explorer and click This PC on the left column.
  • Make a right-click on the particular drive and hit “Turn On BitLocker”.
Turn On BitLocker
  • The system will then prompt two ways of locking the drive i.e. “By Password” and “By Smartcard“.
  • Choose either of the options available there and tap the Next button.
  • The system will let you choose to encrypt either the whole drive or just the occupied space.
  • Select whichever option suits you the most and click Next again.
  • Wait for a while as this takes a few minutes to complete the encryption (may increase for huge data).
  • Once the encryption finishes, Reboot your PC to incorporate the recent changes.

Wrapping…

That would be all! I hope you must now able to password-protect a folder or file in Windows 10. If you have any queries or suggestions, ping us in the comment section.


Leave a Reply

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

How to fix Windows Update Error 0x80070652

How to fix Windows Update Error 0x80070652

You can certainly call Windows 11/10 the best Operating System from Microsoft but still, there are several errors that may occur while performing various tasks.

2023/05/31
How to fix Windows Update Error 80004002

How to fix Windows Update Error 80004002

Several users recently complained of an update error code 80004002 on different Windows 10 forums. Well, this bug occurs mainly due to corrupted system files,

2023/05/31