Folder Lock Without Any Software

Here is a trick using which you can lock any folder on windows without installing any software.

Copy the code provided below exactly and paste it into notepad (Start > Run > Notepad). Save as protect.bat and exit notepad. Double click on protect.bat and you will see a new folder on your desktop called “Locker”. Copy all the files you need to be hidden there. Double click on protect.bat again, and it will ask you if you want to hide the folders, type in y and press Enter. To un hide, double click protect.bat, type in your password and press enter. That’s it!

Following is the code you’ll need to this stuff,

title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
echo Are you sure u 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 Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
echo Enter password to Unlock folder
set/p "pass:"
if NOT %pass%== thisIsMyPassword goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker
echo Folder Unlocked successfully
goto End
echo Invalid password
goto end
md Locker
echo Locker created successfully
goto End

In the above code, don’t forget to edit the line that have your password the above code.

if NOT %pass%== thisIsMyPassword goto FAIL

Update – Check out the following video tutorial that illustrates this trick,

Important Security Note – This is not a good method to secure sensitive data. If you want to keep the data away from the reach of your kid sister, then this can be a good method but it does not provide any security against people with good knowledge of programming. So if you actually want to be sure that no one can ever access the data that you lock, then please use some good software for the purpose.

23 thoughts on “Folder Lock Without Any Software”

  1. No my dear, it works fine on my computer. You may have accidentally done something wrong. Did you read that “Important Note” properly?

  2. Yes it will work for USB drives but you should have access to the bat file (protect.bat) to unlock that folder again. So I suggest that upload the bat file to some place on web or save it as a draft in your email id, then carry the hidden folder in USB and unlock it whenever or wherever you want to. Enjoy!

  3. dude this totally works but there is small room for improvisation.. while typing the password it showed on the screen which defeats the purpose of lock to an extent. I guess there is way to mask it with ******…..

    i can tell this as i have done this in Unix shell dont know how to do the same in windows.. any help from your side ?

    u inspire me to work on my oldie

  4. hey there no locker folder generated and i have read all the instruction carefully can u plz tell me reasn……

  5. @AKSHAY

    Sorry for the late reply. I was a bit busy this week.
    I think that the folder should be generated, just tested and its working fine.

    Just click on the “view plain” link above the code, copy the code, change password, and save it as whateverName.bat, and double click on this bat file.

    I think this should work. If its still not working then please contact me.

  6. I jst tried this.. I created the file protect.bat as said.. wen I double-clicked it for the first time, the locker folder appeared.. I copied a file dat wanted to hide.. then I clicked on protect.bat again but no window or anythng appeared asking whether I wanna hide d folder.. I jst saw a blink of a window but nothng permanent.. y s dis happennin?

  7. @Argha

    This is because you didn’t copy the code to the bat file properly. Click on “view plain” on the code and then copy the code from that box. It should work fine then.

  8. @Jagadeesh

    Forget about the ** line. Just click on the “view plain” on the source code, and copy the code. Then follow the procedure outlined above. It will work like charm.

  9. Hi everything works properly but one problem comes that the Window does not open where we have to type the password.Only folder is made but we cannot enter Y in that because the window only does not come.Pls solve it.


  10. Hi Amit,

    This may be because you did not change the password before saving the bat file. Please read the “important note” above again.

    Thanks for asking :)

  11. @CRACKED

    Yes, the folder will appear on command prompt. But how will you determine “where” to see? Think about it.

Leave a Comment