How to Create a Password Protected Folder without any Software


If you have some important and crucial file in your Windows PC’s and you want to kept in a password protected folder for save and secure. Then you need a password protected folder, and for this many third party software  is available in the market. But this time we bring a method  to create a password protected folder without any software.

Steps to Create a Password protected folder without any software-

1. First of all you have to create a folder.

2. Now you have to create  a new text document


3. Now Open the text document and paste the below code :

title Folder Private
if EXIST "HTG Locker" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
echo Are you sure you 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 Private "HTG Locker"
attrib +h +s "HTG Locker"
echo Folder locked
goto End
echo Enter password to unlock folder
set/p "pass=>"
attrib -h -s "HTG Locker"
ren "HTG Locker" Private
echo Folder Unlocked successfully
goto End
echo Invalid password
goto end
md Private
echo Private created successfully
goto End

4. Change the PASSWORD_GOES_HERE text to the password you want to set. Now go ahead and save the file as locker.bat.


5. Once the file is saved as a batch file you can delete the original text file.

6. Now run your batch file by double clicking on it–the first time you run it, it will create a folder called Private. This is where you can store all your secret things. When you have finished adding all your stuff to the Private folder, run locker.bat again.

7. This time you will be asked if you sure that you want to lock the folder, press the “Y” key and hit enter to lock your folder.

cmd image

8. You will see that your Private folder quickly disappears.

9. If you run the script yet again, you will prompted for a password.


10. If you enter the same password as you set in the script the Private folder will reappear if you enter the incorrect password the script will just Terminate.

If you want to see the Files Again –

If you want to see the files again, all you have to do is unchecked the boxes for “Show hidden files, folders, and drives” and unchecked the box for “Hide protected operating system files”.


If You Forget Your Password –

Seems like once a week somebody writes in asking how to figure out the password they set. And the answer is really simple: Right-click on the locker.bat file and choose Edit.