How To Guides Tech & Gadgets

How To Password Protect Folder In Windows | Without Any Software

Files And Folder Security is an Important part of Individual’s Privacy. Everyone wants that their personal files and folders should not be accessed by anyone else. You may come accross many different ways to hide your personal files and folders for this purpose. But what if you could actually password protect folder so that, no one except you and the ones who know the password can view the files.

So, Let me Tell you a Way by which you can actually Password Protect Folder, That too without using any software :

Just Follow these Simple Steps And Get Password Protect Folder :

  • At First Create a folder, that will be housing your Password Protect Folder, this will be just an ordinary folder and can be located anywhere on your windows and named anything. For eg: We Created a Folder (By Right Clicking  -> New -> Folder) Named “IndianGyaan” On Desktop.
    "IndianGyaan" Folder On Desktop
    “IndianGyaan” Folder On Desktop
  • Open  the folder you created and then create a Notepad file in it (By Right clicking in open area -> New -> Text document), Now Open The text document and you need to paste the following Code there :

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

  • Change The PASSWORD_GOES_HERE text to the password you want to set. Now go ahead and save the file as locker.bat (Remember, You Need to Give .bat Extension only).
    password protect folder
    Change The “PASSWORD GOES HERE” to Your Desired Password
  • Once the Text Document is saved as a batch File, You can delete the orignal Text file, if you want.Delete
  • Now run your batch file (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, the things you want to password protect.
  • When you have finished adding all your secret stuff to the Private folder, run locker.bat again. It will ask you if really want to lock the Private, type “Y” and Press Enter to Confirm. The Private folder will Dissapear. 
    Password Protect Folder
    Type “Y” And Press Enter
  • In order to view the Private folder again Click on Locker.bat file. A window will appear asking you for the Password, Type the Correct Password and Press Enter. The Private foder will appear again. 
    Password Protect Folder
    Type the Password And Press Enter

Note : You can change the password anytime by Editing the locker.bat (Batch File) 




About the author

Sahil Jani


Click here to post a comment

  • Good work. But does the locker.bat file needs to be secured? Otherwise it can be opened in notepad and the password will be shown. Correct me if I am wrong.

    • This Method gives a basic idea about Password Protecting a folder, With Simple Easy to follow steps. And Yes Anyone with a Good Experience With computers or someone who knows about this method will be able to easily crack it By opening the batch file in notepad. But I don’t Think this would be possible for any ametuer Computer user.
      You can hide the Locker.bat file in order to ensure that no one can access it on the go.. 🙂