If you ever wanted to protect or secure a folder on your computer, then this post is for you. Everyone wants to keep something secret or secure or private in their computer so that no one can see their stuff, whether it is your childhood pictures, your bank account details, Accounts passwords, and much more stuff. As we know, we can not remember every password of our accounts and also we can not tell anyone that's why we need something like a lock-in our computer in the case of shared computers. 

You will be happy knowing that now you can protect any folder in windows 10 very easily. Here you will come to know-how after reading this post that how easily you can secure your folder without any software in Windows 10. 

Protect any folder in of windows 10

This is a simple method but you have to be patient just follow each and every step. Just for an overview of what we will do in this method. This method will consist of making a batch file which will contain a sequence of commands for the operating system. When the batch file will be clicked the whole commands will be executed and your folder will be hidden, secured and protected. You will be able to type the password and make the folder unhidden and can access the files in there.

Follow these simple steps to create a protected folder in your computers and remember just follow each and every step carefully, if you skip any of the steps you will not be able to create the protected folder in your computer.

  • Create a folder where ever you want to put your documents
  • Remember the path of the folder where you have created in your computer
  • Now open Notepad from the Start menu
  • Open the Notepad and paste the code below :

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=(more than)"
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=(more than)"
if NOT %pass%== write-your-password-here goto FAIL
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

If you have any trouble in coping pasting stuff and just click the download button below to download the locker.bat file in one click. And also remember just follow the steps below to create the protected folder successfully.


  •  Now type your password by replacing the statement "write-your-password-here" in the code.
  • Save as the file name as locker.bat in the same path where you have created your new folder.
  • Now create a new folder name Private in the new folder with the locker.bat file.
  • In the private folder, you just copy or create anything you want to keep protected.
  • Now double click the locker.bat file
  • You will be asked to Lock the folder just you can press "Y" for Yes and "N" for No but in this case, you have to press "y" and press enter.
  • You will observe that your private folder is not showing 
  • Now you can unlock your folder by just double click on the folder and type the password that you have entered in the code.
  • Now if you have entered the correct password you will see the private folder and eventually you can also access all the files in that folder.
  • If you do not enter the correct password the command line will be exited and your folder will not be unlocked.

That's all you have to do to make your folder protected in windows 10. For more such tips and tricks you can follow this website. If you get a kick out of stuff and tricks like this, you might enjoy some of our posts like How to make an invisible folder on the desktop, How to check who is connected to your wifi. If you like this post, then do share with your friends, and you find any problems do comment below.

Post a Comment

Previous Post Next Post