Password Protect a Folder in Windows Without Third Party Software

Yes, of course there are a lot of third party software that offer the same functionality. But why use something else, when you can do it in the Windows itself? Right? Folder locking have been much in demand since the release of Windows. People have data which they do not want everyone to see, or have access to. So they need to download third party softwares to protect their folders. these softwares can range from few KBs to vaguely huge MBs. And trust me no one wants to have a 100 MB software to password protect a folder that may even be of 10 KB.

WinRar offers password protection for RAR files. So a few people shifted to it for the purpose. But that doesn’t offer you the flexibility and ease of a folder. You need to extract the files and then view it properly.

So today we will tell you how can you easily protect a folder with a password without using any third party software in Windows.

Step 1: Create a new folder at your desired location


Step 2: Open the folder and right click on the empty space inside it. In the context menu, select New -> Text document.


Step 3: Open up this text file and copy the code below, into it.

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

Change the ENTER_PASSWORD_HERE text with the password of your choice.

Step 4: Now use save as to save this file with any name but remember to add extention .bat instead of .txt. (In this case locker.bat)

Step 5: After saving the file, delete the original text file from the folder and double click on the batch file to run it.

Step 6: You will see a folder named Private will appear on the screen.


Step 7: Now copy all the content that you want to password protect into this Private folder.

Step 8: Now run the batch file again, it will now ask if you really want to lock the folder or not. Press Y in the window. You will see that the folder named Private will disappear.



Step 9: Now to view the folder again, double click the batch file. You will see a window asking for a password. Enter the password that you had set in the text file and you will be taken directly to the folder.


And there you have you own password protected folder, without the need of any third party software.You can now easily save your files and data that you want to hide into this folder and view it using your password.

If in any case you forget your password, just right click the batch file, and select edit from the context menu. There you will be able to edit the password for the folder. But beware to use this infront of others. They might sneek up and know what you are doing.

Happy hiding peeps. Do tell us your views about the article, and any queries or questions are welcome.

Related articles

How To Disable Chrome Incognito Mode On Windows And Mac

How To Watch Netflix With Friends From Remote Distance

Best Apps To Hide Photos And Videos On Android

How To Mirror Or Flip Photos On iPhone And iPad


  1. Jimmy says:

    It says:
    File not found – HTG Locker
    The system cannot find the specified file.
    Folder unlocked successfully.

    What should I do?

  2. monuram says:

    and if i delete the .bat file then the entire folder will be gone. again i have to create a .bat file with the codes and then i may be able to get my folder back.
    so my question is Do you have any option to protect the .bat file from deleting or altering it??

  3. monuram says:

    Save the text file in .bat format and save it as *all Files* option from the next down row.
    it will work.

  4. Lisa says:

    I followed your steps and now I can’t find my files. The .bat file is there. I enter the password (and even changed the password a couple of times). Nothing happens. I don’t have a file or folder or anything appear when there should be dozens of files. Can I reverse this?

  5. Glenn says:

    How many gigabytes can be stored in a .bat file?

Leave a Reply

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