How to Password Protect a Folder in Windows Computer?

How to Password Protect a Folder in Windows Computer?

How to Password Protect a Folder in Windows Computer?
Welcome to Asif Kamboh Blog. At this point I will teach you how you can lock a folder on your laptop and PC computer without using any third-party software for privacy reasons. And it works on all Windows (7, 8, 10) operating systems.

The procedure is that we will create a BAT (batch) file with the help of specific code, and this batch file will be your password protected folder software in which you will create your password by entering it using a text file. And then you will be able to lock, unlock and hide your folder and all the files in it.

So if you want to know how you can create your own password protected folder software and use it to protect a folder and it's file in Windows operating system then follow these steps.


How to create your password protected folder software?
It's is a very easy way to creating your own password protected folder software, and which is 100% secure and virus free. And it's compatible with XP, 7, 8, 8.1 and Windows 10.

To create this app, open a Notepad on your computer and paste the following code into it. And replace the highlighted 123 password in this code with your own password, and keep in mind that this code contains two passwords that you need to change and they are both the same.

@ECHO OFF
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
Title Password Protect Folder - Asif Kamboh
echo Are you sure you want to lock this 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 Enter Y or N.
goto CONFIRM
:LOCK
Title Password Protect Folder - Asif Kamboh
ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Congratulations your folder is locked.
goto End
:UNLOCK
Title Password Protect Folder - Asif Kamboh
echo Please enter your password.
set/p "pass=>"
if NOT %pass%== 123 goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker
echo Congratulations, the folder is open again.
goto End
:UNLOCK2
Title Password Protect Folder - Asif Kamboh
echo Please enter your correct password.
set/p "pass=>"
if NOT %pass%== 123 goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker
echo Congratulations, the folder is open again.
goto End
:FAIL
Title Password Protect Folder - Asif Kamboh
echo Sorry, the password you entered is incorrect!
goto UNLOCK2
:MDLOCKER
Title Password Protect Folder - Asif Kamboh
md Locker
echo Locker successfully created.
goto End
:End

After it, click the "File" menu in the upper left corner, and click on the "Save As..." option, or press the "Ctrl + Shift + S" shortcut key from your keyboard.

Once the Save As window of Notepad opens, type the name of the file in it. You can type any name, for example I write file locker. And at the end of the file name, write the .bat extension of batch file, and then save it by selecting the option of "All Files" in save as type.

Now the software is ready to use but the problem is that anyone can edit the batch file in the notebook or see your password. So to protect the batch file, we will now convert this .bat file to .exe so that no ordinary person will be able to see the password in our software.

To convert batch file to .exe we need "Advanced BAT to EXE Converter" named software, and you can download it from this link.

After downloading, extract the compressed (zip) file and install the program setup "Advanced BAT to EXE Converter v4.11ee.exe" file and launch it when the installation process is complete.

Click the "File" tab in the upper left corner, click the "Open" option and go to your batch file directory and select and open it.

Once your batch file opens in this program, click on the "File" tab menu and click on the "Build EXE..." as soon as a click "Select EXE Options" window pops up, in this window, click the "Build EXE" button and save the file.

Before clicking on the "Build EXE" option, make sure that the Windows 2000 / XP / Win7 / Win8.1 / Win10 options are selected in the operating system & exe type. And if you want to add additional information to your exe file, for example embedding files, exe icon, version information, and password, it's all up to you.

As soon as you save the exe file, that exe file is your password protect folder program file, which allows you to lock the folder and all the files in it. And if you want to know how to use this program to lock the folder, follow the next step.

How to Password Protect a Folder?
Once you have created your Password Protect folder program, run it; when you run it, a folder with the name of the locker will be created in the same directory.

Copy all your files and folders to the "Locker" folder you want to lock. And then launch the program again, then the program will ask you "Are you sure you want to lock this folder?" So type Y and press Enter and as soon as you press Enter, your folder and all the files in it will be locked and the folder will also disappear.

If you want to unlock your folder, run a password protect folder program, as soon as you run it, it will ask you "Please enter your password". You have to type your password and press enter button, as soon as you press enter your folder will appear in the directory of the same program.

Keep in mind that the directory in which you have locked the folder is the same directory in which you will have to re-run the program to unlock your folder.

Well now you have learned how to password protect a folder in this article, and I hope you find it helpful, and if you have any questions about this information. You can ask me in the comments section below.
Load comments