In this article, I will tell you a trick that will help you lock and hide any folder without installing any third-party software. With just a simple .bat file, you can protect your folders easily. Whenever you want to open the protected folder, a password will be required before the folder becomes visible and accessible. So, without further delay, follow the steps given below to password protect a folder :
- First of all, open the folder you want to secure with a password. You can see in the below animation that I’ve created a folder named “Demo,” which consists of an image and an HTML file.
- Now, create a new text file inside the same folder. You can name the text file according to your choice. I’m naming it “LockedFolder.txt.”
- Click here, and you’ll be redirected to a GitHub repository. Copy the code given on the repo and paste it into the text file that you’ve created in the last step.
- Now, open the text file and move your cursor to line number 21(if NOT %pass%== YOUR-PASSWORD goto FAIL). Replace YOUR-PASSWORD with the password of your choice. In the below animation, you can see that I’ve used “DemoPass” as my password.
- Now, click on the File option in the top left corner. Click on the Save as button and save the file as “LockedFolder.bat.”
- Now, double click on the “LockedFolder.bat,” and a folder named “Private” will be created automatically.
- Move all the files you want to hide inside the Private folder that we’ve just created in the last step.
- Again double click on the “LockedFolder.bat” A command prompt window will open asking you that “Are you sure you want to lock this folder?”. Type Y and hit enter as shown in the below animation.
- Once you hit enter, your Private folder will be automatically hidden, and only LockedFolder.bat will be visible to you.
- To open your secured folder, double click on the LockedFolder.bat file. A command prompt window will open asking you the password of the secured folder.
- Type the password and hit enter. Once you do that, your hidden folder will be displayed to you successfully.
- If you want to hide your Private folder again, all you need to do is double-click on the “LockedFolder.bat” file again.
So that’s how you can easily hide your private files without using any additional software.