How to create a Password Protected Folder in Windows 7

This tutorial will guide you through the steps required to create a password protected folder in Windows 7 – without installing any additional 3rd party software.

9/27/15 Update: although the screenshots will be different, the method outlined in this tutorial to create a password protected folder does work in Windows 8.

Background and Limitations

While the steps below will guide you in creating a hidden and password protected folder, this method is not 100% secure. It will deter the average computer user enough, but an advanced user will be able to access the contents of this folder. If you want to create a truly secure and encrypted place to store files and folders that absolutely nobody will ever be able to access, see the tutorial How to Securely Store Files in Windows (which requires installing software, but it’s completely free). You may also want to consider simply password protecting a .ZIP file.

Creating a Password Protected Folder

  1. Create a new folder and name it whatever you would like.
  2. example folder on the desktop

  3. Open the folder, right-click on a blank area in it, then select New -> Text Document from the pop-up menu.
  4. windows contextual menu with new text document highlighted

  5. Open the text file you just created by double-clicking it and copy/paste in the following text:

    title Folder Private
    if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" 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.
    goto CONFIRM
    ren Private "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%== PASSWORD_GOES_HERE goto FAIL
    attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
    ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Private
    echo Folder Unlocked successfully
    goto End
    echo Invalid password
    goto end
    md Private
    echo Private created successfully
    goto End

  6. In the above code, replace the key PASSWORD_GOES_HERE with the password you want to use to unlock the folder. For example if you want the password to be 123456, the line should look like:

    if NOT %pass%== 123456 goto FAIL

  7. Save your new file in the .bat format with the complete file name being locker.bat. To do this, make sure to change the Save as type: to All Files (*.*).
  8. windows save as menu
    click to enlarge

  9. In the folder you created back in Step #1, double click the locker.bat file and there will now be a new folder named Private where you can put anything you want.
  10. folder named private

  11. Upon exiting, double click the locker.bat file again. It will prompt you to answer whether you want to lock your folder or not. Press Y and the private folder will disappear.
  12. windows command line
    click to enlarge

  13. In order to retrieve the Private folder, all you have to do is double click the locker.bat file and enter the password which you set in Step #4 and the folder will appear again for you to access.
  14. windows command line with password
    click to enlarge

  15. That’s it!

Again, this method is not truly secure. How to Securely Store Files in Windows will take you through the steps to create a really secure folder (using free software).

1,076 thoughts on “How to create a Password Protected Folder in Windows 7”

  1. Hi friends
    I need help, I am forget folder lock password and I don’t know how to recover. Please help me, how can I recover password or unlock folder? Please help

  2. Sir,
    I have been using this program since long time .
    but now suddenly the private folder is empty.
    it contains all files (viewed in properties)
    but not showing files , please help me

  3. I made it to the last step and the window asking for my password worked once. Thereafter when I went in, it just showed the file I pasted, and I was able to open the file normally, that is to say: the file cannot be password protected.

    It is really frustrating because I’ve seen it work, and I have reordered the hierarchy every way possible, but even so I cannot get “locker.bat” to block access to the “protected folder” or its file

  4. The tutorial was clear on how to do one by one step, even better than most of videos online.
    Very helpful too.
    Thank you!

  5. it just hide folder. if yo choose the view option of show hidden folder than you are able to see the protected folder.

  6. Anyone can open and see the password whatever it is there in that script.

    So this is not the correct way of coding :)

  7. hi may i know, why when i share the folder, but want open it at other pc i share, i cannot access for unlock folder, Can you guys help me to settle this?

  8. works but when you click on locker once, text comes up on right hand side preview window showing code how to unlock it. am i doing something wrong??

  9. Dhamodhar Reddy

    I have followed all the steps given and successfully created the password.. I kept all the date in the private folder long back ago.. Now I am trying to open that batch file it is showing “Windows cannot access the specified device, path, or file” error when you try to install, update or start a program or file”.. Could you please help me how can able to access this private folder again.
    Thanks in advance


    When copied the suggested macros, by mistake I didnt copy “goto FAIL” after the place to change the password. I created the Private folder, copied my files. Now I am not able to retrieve back my files. Suggest me what to do?

  11. There’s no doubt, As Windows 7 is the most recommended OS, Which through user can do almost all work without any problem, Where I recommend you to activate your OS being purchased its license code from ODosta Store
    Which is distributing license for almost all types of Microsoft Products. I personally use it and have a good experience.

  12. Deleting the locker.bat makes it more secure. Just preserve the batch program code somewhere and remember the password
    When you have to see the private folder, just create the locker.bat once again (following the same steps and entering the same password)
    More secure way!

  13. Hello, it workes great, BUT if I go to toolsfolder optionsviewhidden files and foldersShow hidden files, folders, and drives -> then returns me the folder like an invisible and i’ll have the same acces whitout password :)
    Kind regards,
    Alex G. from Romania

  14. I can not seem to get this to work. I followed the steps up until where you get the folde named as private. Then i’m stuck (because the private folder isn’t showing up.) I think it might be becuase the text document isn’t saved as a .bat file, but i’m not entirely sure. IF that is the case how can i save it as a .bat file?

  15. Nematullah Chandio

    I have done it and it worked, but as I installed new WINDOWS it does not play my videos and gives this message:

    Windows Media Player cannot access the file. The file might be in use, you might not have access to the computer where the file is stored, or your proxy settings might not be correct.

    Please help me come out of it..

  16. this is useless method..because why, when bat file is created you try right click on it and click edit after that your password and another text will appear

  17. @ECHO OFF
    if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
    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.
    goto CONFIRM
    ren Private “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%== PASSWORD_GOES_HERE goto FAIL
    attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
    ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Private
    echo Folder Unlocked successfully
    goto End
    echo Invalid password
    goto end
    md Private
    echo Private created successfully
    goto End

  18. the folder is renamed ” controlpanel bla bla” and hiden in the same directory (folder). you don’t need a pasword to open the files.

  19. Pingback: How To Install Windows 7 In New Hp Laptop | Best Laptops

  20. Garry Pitpitan

    what a dumb head you all have.just do what the procedure given to you by uploader and thats it it works fine dude.its simple procedure!!!!1

  21. file get hidden. But when we change to show the hidden files , folder gets up by name “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”. when i open it it shows all the data. Foolish idea.

  22. Ramnath Shodharthi

    I am putting the password correctly but not able to retrieve the private folder..what to do?..please someone help me….Thanks

    1. Just open the bat file in which you have entered the code and search for:
      if NOT %pass%==
      and then after == see the password and that will be your password.
      E.g. , if NOT %pass%==1323 then your password will be 1323 &also watch out for spaces.

  23. i just made the .bat file but when i put in Y when they asked, it said that access is denied, any idea why?

  24. You should compress the file into an .exe file after making the password to make sure no-one can find it out

  25. HI,
    i made a lock folder and its worked but now i connect my external hard again but now its show private folder empty so what to do now.
    please tell me any how can i view my folder.

    1. It will not work in external hard drives or chips or pen drives. As control panel’s folder vary from computer to computer. Also if you had formatted your computerame thing will appear that is folder is empty.

  26. HI,
    i made a lock folder and its worked but now i connect my external hard again but now its show private folder empty so what to do now.
    please tell me any how can i view my folder.

  27. I have completed it successfully. But one thinh that needs to be improved is password should not be shown while entering. It soulld be in * form. If that can happen then it is perfectly fine.

  28. this keeps failing once I fill the file with documents. how do I fix it. Will not let me lock. On windows 7. Odd but this used to work but now it doesnt and I’ve tried remaking the file.

  29. I need a folder password lock

    so basically you just system hide the folder instead of really prevent people double click it and prompt for password?

  30. I By mistake deleted the .bat file when my private folder was disappeared. how can I get my disappeared file back? it had some important data in it!! :-|

    1. i have experiment now , after delete the locker file, i made new locker file with same password in the same folder where i have lost my files folder , and open the locker file with previous password, and my hidden folder come back,, u try ,, if there is any difficulty so u can call me 0313-6352858 , m from pakistan

      1. HI,

        i made a lock folder and its worked but now i connect my external hard again but now its show private folder empty so what to do now.

        please tell me any how can i view my folder.


  31. Hii have tried this its really good, but while doing so I had a doubt and dleted the Locker file, and got simply deleted.
    What if, some one else delete the Locker.bat file, do we loose complete folder or any way we can still retrieve them

    1. Sundram(

      Its a way to retrieve them, i.e. , just make the same bat file with the SAME CODE and PASSWORD, then open it & use it………EASY……….

    1. Just right-click and hit “Change”. You’ll see the text file and then you just need to change old passwodbsartsrd to new passwodbsartsrd!

  32. It only puts the folder as Hidden. no protection there..none!!! go Folder Options and check Show Hidden Files and you’ll see your Folder under a somewhat different name but when opened you have access to everything. Fancy Way to put folder as Hidden.

    1. Sundram(

      In the above code, replace the key PASSWORD_GOES_HERE with the password you want to use to unlock the folder. For example if you want the password to be 123456, the line should look like:

      if NOT %pass%== 123456 goto FAIL

  33. Husnain Kazmi

    Someone could comprise the folder is to open the batch file and read your password to Right-click on the locker.bat file and choose Edit. It’s definitely not a really secure way to hide your files.

    1. u can simply rename the batch file to .txt and rewrite the password xD
      it’s not that secure if u know smth about batch files

    2. Sundram(

      Right-click on the locker.bat file and choose edit and see for password after the line if NOT %PASS%==……………..

  34. Thanks for sharing! I am using a software called Lock My Folders. Work as similar as your trick, but it will also encrypt the files on the fly.

  35. I tried it and it worked my folder was now private but as i open it again the private folder was there but my files was gone. please help how o retrieve.

  36. nice! but if I right click the file and then edit file, I can still get in because you then get the normal text file with the password showing…

  37. Titanicjohn peter

    Perfectly Working but edit option is enabled.
    Suppose if Editable option is enabled Other user Can change the password.
    That is hacking so how can disabled edit able option in locker.bat only Suppose if you can’t try it other code

  38. How to hide the .bat file then?
    When i right click the locker.bat,
    it just appear my password inside the notepad.

  39. Unfortunately I did not change PASSWORD_GOES_HERE these words but typed Y and click i can not access to my protected file.So what should be done now?

      1. Just edit the BAT file by right-clicking it and selecting “Edit”. It’ll do the trick :) and go to where you need to change the password.

  40. i made this step and now i can’t access any file from the ones which are at the same folder and i can’t discard any of the changes done even when i changed the windows
    how can i restore my files back

  41. pradeeban pradee

    THANK YOU SIR……………………………………………Shan Ahamed Shaikh when you double click the locker.bat and click Y in command prompt after you close the private folder,it make it unvisible to computer search Try it and leave your comment

  42. Shan Ahmed Shaikh

    this is not secure…. i did all thing, and it goes right, what ever u say. but when i use search the files, from startup menu, it shows me all files,

  43. when I click the bat locker.bat it hide the private folder but come up an other folder call control panel containing the files that in the private folder please help

    1. I think there was a problem while making this steps, Try again doing steps again for the first time to you and feedback me.
      Specifically the typing/coping way of the code.

  44. I see this same bullsh^t everywhere, copy and pasted from other sites —- you are so f^^cking unoriginal. This bullsh^t is also insecure because it doesn’t hide your password as you are creating it and only HIDES the files – I CAN STILL ACCESS THEM! What a f^^king pathetic lie of a “Password Protected Folder.”

    1. Why are you using such vulgar hateful immature sick language just because you don’t like this folder. Is there something wrong with you. Please see a doctor asap.

      1. “Sick language?” “See a doctor?” Are you a ret@rd O_O?! – rhetorical question. You need to see a doctor if you can’t handle it — GET BENT!

      2. You’re not contributing anything. If you don’t have anything to useful to say, they why comment? — Useless brown-noser.

        I, however, have every right and reason to point out a sham. I also have every right to respond to comments made to me, YOU are just sticking your nose where it doesn’t belong.

      3. “I also, I have, I do, I am, I… I.. I…”
        Just give this world a favor, kiddo – STFU u ‘lil piece of sh*t.
        I am sick tired of such a genetic garbage like u.

      4. I guess instead we should talk about you… that’s a good idea! I have no reason for me not so use those words, they are parts of BASIC HUMAN SPEECH. I haven’t attacked anyone here like you, and yet here you are with your tiny-dick-roid-rage, throwing out profanity like a little kid throwing a tantrum. It’s evident that YOU are the real gutter trash here, yeah, YOU should be one to talk! You have some serious problems, little child. Go bang your head against a wall, I’m sure you’re good at that — and not much else.

      5. How about you fix up, because frankly we have the right of freedom of speech but you are one of this disobedient people who misuse it and you don’t personally know these people so they are are ones to talk.

      6. I’m disobedient?! Not very smart, are you? Freedom of speech is not about being obedient, it’s about saying things EVEN IF YOU DON’T LIKE THEM.

        “they are are ones to talk.” Again, you stupidly talk about what you don’t know. You don’t know what the idiom “you should be one to talk!” even means.

      7. Kirilas Lukjančenko

        man if u so critical and tuff create something better gush genius make site and be papular o.O why need being so rude….

    2. grow up kid…It is to protect from people that have no idea what they are doing like you,,,,if you knew what you where doing you would need this! this is just to protect your files better than leaving them opened and only a skilled user would try to edit the code and look for the password. calm down…this does its job well

  45. Mahmood sir.this folder can delete easily what is the way to secure it from deleting in other words
    Mahmood bahi ye folder delete ho gata ha kia ho sakta ha ka isa bachaiya gai bara bhai delete kar dete hain

    1. right click on folder or anything you want to protect,
      then choose “add to archieve”,
      the from the new window appeared click on “set password”,

  46. It works well to keep the novice out. For added security, rename the ‘Locker.bat’ file to runtime.bak, then move it out of the folder to the root. this way any spies would see just an empty folder, nothing suspicious

  47. I just did this on the work computer for some shotty folder that I don’t care about. A lot of the comments are pretty pessmistic because you can change the .txt file.

    Guys… just delete the .txt file, or move it into the private folder. Done and done. :D

  48. Pingback: How To Fix Error 2107 How To Password Protect A Folder In Windows 7 Errors - Windows Vista, Windows 7 & 8

  49. it’s good
    but anyone can edit the locker.bat file in notepad and can change the password as they want
    and hence there is no security in this method

  50. You can simply access the contents of the folder by searching one its contents ,then you open file location. It doesn’t work. Simple windows 7has got no folder lock app. You need to use a third party software

  51. in which folder i had made private folder that new folder cant seen. and all my locker.bat file and private folder with secure files are in that folder. so, how can i access it

  52. when key-in password, an error message appears:
    Invalid password
    ‘Read’ is not recognized as an internal or external command,
    operable program or batch file

  53. Just a further suggestion. Make ur password using the “Alt” key. It will typically convert ur password in some ascii format.. Like
    A typical sign will appear. This will be difficult to break.

  54. If you open the preview pane, you can easily find the password. Is there a way to hide the preview pane?

  55. I don’t want to kill the popularity of this post but the FLAW of this method is so obvious. Open the .bat file with the notepad, change the password and VIOLAAA!! You can open that private folder again.. :3

    1. Cool! But thanks anyway, I just managed to get back all the files which I was unable to retrieve by entering the password set.


  57. Pingback: » The Word – 12/9/2010

  58. Worked great for me, many thanks! It is for the “average computer user”, which I am and most people around me are, so I feel secure.

  59. If you just protect the general files/folders from other people, this must be a very good free way. But if you need to protect more important and sensitive files on computer, using third party software such as Kakasoft Folder Protector will be more secure.

  60. Its a good way to keep the novice user out. But anyone that knows how to open a bat file in notepad can find the password. Honestly a Windows native folder password system built as part of the OS is 20 years overdue. A more secure but still not 100% way of doing this is to create a compressed folder which can be password-ed.

  61. Windows 8.1 If u right click on locked folder shows edit option & u click on edit ….it shows details of password…….

  62. i don’t what’s wrong, but when I tried it on my computer, the folder is still accessible, only the folder name’s that change

  63. Doesn’t seem to work – I created the file and the Private folder came up, but even if i lock it i can still access it. Any suggestions?

  64. DamienSnijder1994

    only one thing they can change the password really simple and then they still can enter your locked folder by typing the password they have choosen so what to do about that??

  65. This is great but i would recommend to to take a copy of bat file and save it somewhere safe in other folder… Incase if anything goes wrong…. Individuals with basic scripting knowledge can easily work with this… for other people i ‘ll suggest to dowload Folder lock free softwares from website.. !!!

  66. Praveen Kumar P

    Simply type ” * ” in the search bar (Windows 8.1 OS),all the protected files will be shown in search screen :(

  67. Hi all, I tested the system and it worked fine, then added a number of files and directories. Ran it and it did not work, now if I do it is comes up with access denied, but I can still see the directory

  68. I updated to win8.1 and now i can t get to the private fowder and i need the files that are inside it

    1. its dosen’t work u see why?

      the private file can be accedes when show the hidden fie is active and it can be opend without password

  69. This only protects against novice users.. you simply right click and select edit and you can see the password.

    1. The only best way is to Move the batch file to some other location when not needed…. Whatever,.. Getting a Folder lock for windows 8 at free of cost really sounds good for me….!!! Great day

  70. Sorry if this has been answered before, but: this worked for me a few times, but then when I double click and enter “Y” nothing happens. The private file does not disappear! What am I doing wrong?

  71. This solution is widely used to protect files on computer, but in fact it only helps hide the folder from others. For more important files, you need strong encryption solution.

    Kakasoft Advanced Folder Encryption is one of excellent file/folder encryption programs, you can download the trial version to have a try.

  72. Hey guys, why don’t you just put the password as a giant number? If someone clicks edit, the person won’t know where to look, and if you forget the random number, YOU can go to edit!

  73. This is very helpful! You see, no one in my house knows how to use the pc without installing Babylon, so you shoudn’t use this unless you’re like me! #HentaiTime

  74. It rather would be easier, if you make your own user in you computer rather thatn locking a folder, cuz its fully visble as finding the sun in the clear sky

  75. Pingback: How to put a lock to a Folders |

  76. to make sure that your folder is protect cut and past the File,bat in the private folder when you close with the locker your text document showing your password is not visible or accessible as it is in the private folder lock and to open it you need to know the password

    1. but my bat file open(private folder appear) wheather I supply wrong password. I mean bat file demand for password to open private folder and it function wheather password is either wrong or correct. Please let me know,

  77. its work but!! the only changes is the name of the folder…
    No changes.. the contain of the private folder is same in “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” No Good!!

  78. Whatever you said that is working. But data saved in Private folder also visible in ”Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Folder, which is automatically creating after applying Lock on folder PRIVATE. then what is use of folder lock????

  79. It’s nice but if you right click it and click edit you can simply change the password. It would be good if you first have to type in your old password to get the possibility to type in a new one

    1. to make sure that your folder is protect cut and past the File,bat in the private folder when you close with the locker your text document showing your password is not visible or accessible as it is in the private folder lock and to open it you need to know the password

  80. its useless because if you unlock it, it make a folder named control panel. And if you clicked that without any password, your files will appear. So please help me, how can I delete the control panel if every time you’ll unlock it, it will appear?

  81. well its quite useless because it make a folder no more than a system folder which can be seen under hidden files and option of protected system files :(

  82. Md Sirajuddin

    Hi buddy, these seems to be good but not exactly good and secure way for making folders as private… If someone searches with some key word such as confidential, private than that is visible in search results So finally user can open it and can access of files… which supposed to be private and locked.

  83. Bisma Joyosumarto

    It worked, but I found out something: On step 3, you can change every single “Private” into the name of the folder you want, but you need to replace spaces of both the folder name and the password into signs like _ But I also know how to take over that locker.bat file and change the password. If you know how to change file types by renaming them, then you should already know how to take over that locker.bat file. That’s why this page said: “While the steps below will guide you in creating a hidden and password protected folder, this method is not 100% secure. It will deter the average computer user enough, but an advanced user will be able to access the contents of this folder.” This quote meant that some people (like me) know how to take over that locker.bat file. Sorry for a long comment.

    1. There are certain possibilities

      1) You must have did it on the desktop
      2) You must have not changed the name to “locker.bat”
      3) You must have not changed to “All files”

  84. I have done everything, this is not working for me. when i Lock the private folder it does lock and rename private folder BUT when i double click the one that renamed Private folder it opens everything that is in private forlder. By that the folder is not secured at all

  85. I have done these all step every thing was good BUT it after these all process it was just compiling private folder..did i any thing wrong.??

  86. Hi, use this method but sometimes the folder does not lock and is still visible.
    one i restart the pc then i am able to lock. any ideas why?
    thanks a lot

  87. but i can open folder Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} while it is locked. what should i do?

  88. if u forgot your password’s do this :

    Go to the “locker.bat”
    Right click / Edit, and you can see your password. :)

  89. Not secure. you can easily find the private file by checking out the “Show hidden files” and “Hide protected operating system files” in Folder option. even if you have the “locker.bat” file or you delete it. If there are any solutions for this, please help me…

  90. in this method, unwanted user can easily retrieve the password from the text document. so any solution for this?

      1. i meant after i save the file like in step 5, i can reverse back the step and convert to text file again. that what can i do?

  91. hey bro..great work…but there is some problems…it will open the file with any password..even i press wrong password. another one is any one can delete the bat. file…bt i have solution for this..u can make a bat. file to exe file..and that works..

  92. works very well, but I would suggest not putting any very important documents inside, as anybody can in fact delete the ‘Locker.bat’ file and then of course all files within it will be destroyed! :D

  93. Not secure. Open the document in a text editor without need of password which then shows your password in the text. So the question becomes how do you lock the lock so people can’t access the password.

  94. thank you very much, although you cant hide it when you search what you hide you can find it and if someone wants to they can do whatever they please with it

  95. hey friends…
    Its not useless, because you can use security on locker.bat to avoid your password from being changed by anyone else, And no one can access the private folder from folder option…..(

    1. open the locker.bat and read the password that you set. just like anyone else can. This process is not very secure at all.

      1. I agree this will never be that secure as you can read your password from the preview pane. However reducing the font to size 1 and changing it to wingdings or something like that makes it perfectly acceptable as a medium nosey parker only type security, might not keep my bank codes in it but for anything else……..

      2. you can change the file name alsp with bat file you need to do2 change at first line and last line where mdlocker insted of locker you can write your personal name at both place and save file at that name.. it will help you.. in some way

  96. Just back everything up on an external drive and whatever data you have left on the computer archive it with WinRAR and set a password.. boom, problem solved!

  97. actually, your folder was just hidden (as it became a system folder). you can still view it by going to:
    control panel>folder options>view tab>click “Show hidden files..>uncheck “Hide extensions..>uncheck “Hide protected operating system file.”.
    you can now view your folder but it’s folder name is Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}.
    viola! anyone can now access your folder.

    1. if you are using windows 7, go to:
      control panel (View by: Large icons or Small icons to easily find “Folder Options”)>folder options>view tab>click “Show hidden files..>uncheck “Hide extensions..>uncheck “Hide protected operating system file.”.

  98. Very nice dear but if some one delete that lock file then ???????????? where is our lock folder and can we open that

    1. That is the other issue. Then it would just be a matter of creating another bat file. since the password is set in the bat file it doesn’t matter that you have to recreate the file.

  99. the bat file asking password but the private folder which my files are there is showing out all my files when clicking on that file how is it possible?

    1. Krishna Varshney

      miss. it is too easy when u save data in private folder then u click locker or type y then your private folder will automatically locked….

    1. dude agr tere koi locker file delete krta hain toh woh file hi dte hoti hain data nahi …wohi file bana kr tu file show kra sakta hain

    1. Do you look for things you don’t know exist? If someone doesn’t know the disappearing folder exists, why would they look for it?

      1. “Do you look for things you don’t know exist?”

        If I’m looking for hidden files on someone else’s computer, then “Yes.” It’s very easy to turn off hidden files and folders, it’st the first thing I do when I set up any pc. To feel a sense of security just because you set a file or folder to “hidden” is absolute stupidity.


    1. If we remove our password from locker.bat file then any one who can access that file and can edit locker.bat file with new password and can access data.

    1. yeah u can easily … just right click on locker.bat file and then on edit . There u can see your password written . It helps , try it out …

  101. This is Not Godd!!!!!!!!! When You save The File. Click on .bat File and Open with Notepad and then You Easily Change the Password. So It’s Not Work Properly.

  102. its just a vogus trick, if someone deletes your file or cut the
    locker.bat folder to somewhere else, then the whole data in it will
    delete. So, be aware of it. its better to download third party software
    like folder lock, etc.

  103. when first time i locked that folder it was locked and it was opened when i wrote the password but when the second time i tried to lock the folder it was not lock and the error accured that the action is denied, can you please help me to solve this problem??

  104. It’s awesome, but my question is this if you secure the personal data with password and of course the data will be hide expect locker.bat file, but in my absence if some one delete the locker.bat file then? is it possible to make the restriction or unable to delete the locker.bat file by other user???

  105. You can make the .bat file a hidden file and turn off the show hidden files and it will be an empty folder till you need something in the folder then

    turn show hidden files back on again.

  106. very usful thanksssssssssssssss…………………………………….

  107. your_face-->my_ass

    So this is not TOTALLY useless, just mostly useless. it is only good if you are trying to hide something from people who are not computer savoy or if you just want to prevent someone from accidentally opening a folder you don’t want them to see. My advice, go ahead and pony up the dough for one of the programs that makes it easy, that is what im going to do.

  108. Total useless..
    here example is only doing folder to rename & hide. and on unlocking means it will rename to original folder name and unhidden it. thats it. not secure or not need any password for to do it in easy way.
    you need to some googling, and you can make hide/unhide batch file easily. LOL
    BTW Good joke here.

  109. Anyone can pass this password if they know what it is and how to make it. For example if you locked the folder with locker.bat with a certain password Ex. 123. Someone can make another locker.bat file with a password of their own choice Ex.12345 But they have to first rename it to lockerr.bat so they move it into the folder that has the locker.bat file in it. When they move lockerr.bat to the folder that has locker.bat in it they can use lockerr.bat to open the file locker.bat has secured. Using any password they want.

    1. so just move the bat file to another folder you know…
      well then nobody could find out the original location so your secret file is secure..
      when you want to open just bring the bat file in and open it..

  110. WARNING: It can be simply unlocked, in the folder options if you remove the tick for hide protected operating system files,then everybody can see your folder,it seems useless

  111. Hi done correctly, it has working also correctly, but nothing is hided in there, once you click on that locker folder everything is open, what should i do, please anyone can help me out of this.

  112. Thank you it works but when I click right click mouse it show edit but if you didin’t do with someone who is with you he will not gonna know what is your password so don’t worry about it guys….

  113. Just a question. I went through the whole thing and it seems to work, but how does the folder open? It asks for my password, I put it in and nothing happens. When I click on the folder all it does is asks if I want to lock it or it asks for the password. What am I missing?

  114. my locked file’s won’t open? even with the right password. i’v used them with no problem 4 a few week’s,, now they won’t OPEN ?????

    1. Simple mate just create another same file like that name it locker.bat and save it in trhe password protected file since there was already one there i will ask you to replace it say yes and you changed the passowrd!!!

  115. quite good, it served my purpose but any person who is better than a noob will find the password. Please find a solution for the problem.

  116. Sujeet Agrahari

    Dear there is a problem anyone can delete locker.bat and with your file will be also deleted .SO please suggest a solution.

    1. if they delete locker.bat only, then my friend, your files will not be deleted..
      you can create a new locker.bat and that will do the trick…
      but if any body deletes the file which contains your secret file then your data will be lost

  117. I have one problem. I have put the password correctly but during opening it is saying that the password is not correct. Please tell me how to open the folder. I have checked the password is correct.
    One more quarry–Suppose i have locked a folder in my hard disc in one computer with one password. Can it be opened in another computer with the same password from that harddisc?

    1. delete the existing batch file .. and create a new batch file with a new password and try again…..
      For your second querry,,the answer is yes

  118. Themusiciangedemondan

    Not to secure, but good. In the option to edit the batch file you can change the password easily. My 12 year old brother could find it out easily(but he does know a lot of coding)

    1. keep the locker thing in any other folder..example in your game folders ..

      where only you can recognize can also rename it there..

      nobody except for you will know where this batch file will unlock your secret folder..if you double click it in another folder it just creates an empty folder named private…have fun..

  119. ive done this easily but anyone can get in as it says the password in the locker thing… anyone have a safer or way to hide it?

    1. keep the locker thing in any other folder..example in your game folders ..
      where only you can recognize can also rename it there..
      nobody except for you will know where this batch file will unlock your secret folder..if you double click it in another folder it just creates an empty folder named private…have fun..

  120. Like I said, ive done that.. its just I am unable to open the locker.bat to unlock the folder. The windows command processor just flashes and thats it.

  121. …In addition, when I try to run the locker.bat or edit it, it says Access Denied, btw, I have copied the hidden folder from Windows.old, but I already have the ownership of the folder and the locker.bat file but I am still dont have permission, helppp!!

  122. guys please HELP, i have reinstalled windows and I copied my hidden folder that I have created using this method and I take ownership of the folder but when I try to open the .bat file or the exe that lets you put the password, it says I dont have permission? But, I have already take ownership of the whole folder.. please help asap!!

    1. just stopping in

      use a linux boot disc, like ubuntu, linux will let you look at anything without permissions…and you dont have to install it..just hit the try ubuntu option

  123. If you create a password protect folder and you put stuff in it and you move it all your stuff is gone?? Why??????? then it is not helpful at all?

    1. just stopping in

      your stuff isnt gone dude…put the locker back in the file you created the private folder, unlock and voila your stuff is there

  124. Pretty neat but anyone who knew to do it would open the .bat file in notepad to get the password. Also any folder you have locked can be accessed through the ‘frequently visited folder’ list without entering the password.

  125. Hey. I get as far as step 6, and when I got to 7 command prompt open and closes too fast. It asks for the password, then the next line tells me
    The syntax of the command was incorrect.
    goto was unexpected at this time.

    Any ideas.

  126. I’ve done every step tell #5, but when I double click on the text document there’s no file named “private” appears it normally open the text document :/ !!!

  127. Pingback: Creating Password for Folders | myseluch

  128. But, It just makes the folder hidden….weak solution…showing hidden folders option in is very easy to open, moreover opening the batch file anyone can find the password…

  129. its cool but its still not safe, because when you change your folder setting in show hidden file, and you open the .bat file a hidden folder that have a file name of Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} will show and you can see your file there even you did not enter the password.

  130. one question tho i did try something i made a new folder and i tried to open it and cmd asked for a password so i deleted the .bat file and it deleted is there a way to make it so some1 who doesnt know your password cant delete the file without a password

  131. I have problem password (alt 0160) cannot be read or something. The .bat file can be open but when i type my password with (alt 0160), the folder is not showing. is there a solution?thamks

    1. it’s super but not secure so lock.bat use and go to control pannel , folder option hide the batch file it’s secure 99%

  132. Unfortunately I got my files lost with the batch files above. Now I am using a more secure way to lock my files with “Protect My Folders 1.3” program.

  133. Actually you can put the .bat file on a thumbdrive or move it to another folder. When you want to unlock the folder move the .bet file back. This is cool for free.

  134. This works on my Minecraft Folders, so my 8 year old brother can’t open Minecraft any play on my profile. :D But it doesnt work on my also technologically advanced 12 year old brother. :/

  135. dude you should have mentioned, if anyone open and reads the batch file, he will know the password :-)
    or even if show system files is set, then the folder will show :-)

  136. divyansh chaudhary

    When we lock the folder there comes another folder that contains all contents of the Private folder…. what can i do

  137. Its really work & help me a lot
    But is their any way that can protect my folder being deleted

    Like require a p[assword when any 1 trying 2 delete it

  138. Hey all. Doesn’t totally make it hack proof, but put your document with your password in the private folder itself.

  139. its awesome but can you stop editting the .bat file so that no one can edit it and see or change the password other wise any one can edit and change or unlock it.

  140. This is not wrking….when i opend the control panel folder after locking the folder showing the content of the files inside the private folder….

  141. this is not useful..!! if somebody deletes the folder or the locker then, how could i view my files inside the folder or the locker?

  142. Pingback: How to create a Password Protected Folder in Windows 7 « Information Technology

    1. Its actually very easy to hack because of how easy it is. Right click the .bat file and then click Edit. Find the line with your password on it and there you go.

  143. It works but, If you go to start and search for that folder or a specific file in that folder it still opens it. e- e

  144. thanks. it worked. to users who does not work, i think you forgot to change the file format save, look at the pic5 bottom. And you may success.

  145. I keyed in my password but it still says password invalid and it doesn’t open up my folder! How can i correct this and retrieve my folder and files again? :(

    1. Right-click the locker.bat folder and click Edit. You’ll see your password. All you got to do is change the password and click Save

  146. When I try this it creates a folder named “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” when I lock the “private” folder and when opened it contains the files that were placed in the “private” folder. Can anyone help?

    1. you have to double-click the locker.bat again, there’s a prompt says “are you blablabla” type Y then ENTER. That’s it.

      1. i am also having tha same problem i.e (after locking the folder the private folder has changed the name to control panel.{21Ec……….}.wat to do?

  147. I don't understand

    It locks up only once. When I access it and then try to lock it again, it just creates another Private folder. How do I solve this problem?

  148. Muhammad Awais

    it has faults if you search for the things in the start menu that you have kept in the locker they will show up despite being locked up

  149. Swisten Harsh

    if any person delete this *.bat file so how can it possible archive our data inside the private folder

  150. This is only really good to use if you’re just trying to keep curious people out of your stuff. It’ll keep most people out of your stuff, but occasionally people might take the time to open up the batch file and get the password, so it isn’t suitable for private company documents and the such. In that case you would be better off using a third-party program or an encryption service.

  151. That’s awesome but with the one drawback , “password known” in the code .
    I would like to give a solution to it by suggesting you’ll to save the text document containing the code in someother folder so that password cannot be hacked
    I did not try it… This is just a suggestion

    1. Hello everyone I think I have a good idea of getting rid of this password security problem in protected document storage. The literal idea is to cut and paste the document containing code within the private folder itself with the password hidden in your smart phone memo…. :-O:-)

  152. but what is the use of this batch file as and when you click on the file it shows the code, you have to click on hide the preview pane. you will get the complete code with the password!!!!!!!!!!!!!!

  153. Is there a way to name this something else besides Private?

    If I try to rename it it just creates another Private folder and not the renamed folder.

    1. In the coding change all the parts that say Private to the name of your choice. Just try not to delete anything other then the words Private

  154. A nice little solution for the batch file is to set it as hidden but save the location into an unnamed text file then just copy into Run which then access’ it without anybody being able to see the actual batch file and it’s programing!

  155. I have lost all of my files now? Please HELP! I have done everything as described but now when i click the Private file nothing appears!

  156. This works exacly as described…ONLY ONE MAJOR PROBLEM. After i created the file and was pleased it worked–for the heck of it I did a “search” for the files that were in my newly created “private” folder…to my surprise the supposedly locked files could be viewed (and opened) from there. Any advice on how to slove that?

  157. When I lock mine creates a new folder that is called Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} and you can go to that to open all the files.

  158. This display the PASSWORD of which I don’t want a password to be shown,

    The message says enter the password…………..which is my password.

    I want to hid the password?

    please assist

  159. hello, I forgot the password that i have created. want to retreive that folder its very important, so can any one please help

    1. Open notepad, drag the batch file (the one created in the tutorial) into the notepad windows. Then, where you typed your password to set it, you should be able to read it

  160. When I created a locker.bat file and double clicked it. It simply pompt the cmd widow for password. No private folder is created.
    Please help

    1. You need to make sure it is directed to “all files” when saving, and before you save the code at all make sure you delete “PASSWORD_GOES_HERE” and put your ideal password in its place.

  161. Who made it, I just want to know that great man Identity. Really Awesome. THANK YOU SO MUCH. …:)

  162. BatchBeginner

    It worked for a few weeks, but i went there this morning, unlocked the file successfully, and tried to lock it back after im finished with my work. But it says:
    The process cannot access the file because it is being used by another process.
    File not found – Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}

    pls help.

  163. If I just right click on the .bat document and click “edit” I can see the actual code, including the password I put in. Is there any way to make this more secure?

    1. BatchBeginner

      Haha yeah, it isn’t very secure in my opinion. Anyone that knows batch can see the password. What I did was I made it create the “private” folder in another location, so it’s harder to be seen.
      But I dont know what you can do to make it 100% secure, maybe ask batch experts.

  164. I put the password in and i gained access the first time but every other time i access the folder it just opens without the need to enter the password again.

  165. have anybody tried to type a wrong password? cause even if i typed the wrong password still the private folder shows up and all the subfolders too and have the full access.

  166. let me say a tip for a good update of this batch file: change the file name to ” ” (alt+0160 its a blank space, not “space” but its a space lol) and change the location of this folder and then change the icon for a blank icon (may require a vbs script for detecting the OS. if it is a different OS then the icon index may be different) bla bla bla i think u got it

  167. the folder is not locked.. its just hidden with the System and Hidden attributes ;( i thought u had a real password for the folder but it looks like i was wrong lol

    maybe u could create an vbs script with some move and a real LOCKING engine by entering some values on the windows’s registry but let these people be happy with the illusion of a secure folder =D

    i think more than 90% dunno that for just typing on cmd: ” dir /ah ” on the folder will show up this folder and then.. someone will be able to access the folder =o

  168. Worked when I set it up and I’ve tried it half a dozen times and always works as described. So a great idea for which much thanks. (And to those who say it can be cracked – yes of course but it’s not intended to defend information against determined & tech-savvy attackers; just to keep stuff from prying eyes; which it seems to do verty well.)

  169. thanks a lot. this worked well enough for me. I don’t think that people will try to open the locker.bat file for no reason so the hidden file would be safe enough.

  170. This is not a safe method to lock the folder as when i opened the history of my computer there was a content of all opened files from locked folder and when i clicked one of the file from history of my computer it opened without requiring any password.

  171. what is the best way to make it so you cant view or edit the locker.bat file. If someone has reasonable coding knowledge they can view and find the line in the code with your password which is unencrypted

  172. Jennifer L Carter

    This doesn’t work … it worked at first but after I locked it again the folder will not open again … now my files are stuck in there :(

  173. This didn’t work for me. I followed all of the instructions above but then when I opened the folder, no password was requested! Fail.

  174. Jared Hoiting

    Looks like a hoax. I tried this method. When “protected”, the folder only gets the status of hidden file. Everyone can set the computer to show hidden files. Click on the hidden file, no password is asked, and the content is shown. This is not as advertised.

  175. I need a help, when i open my bat file with the right password, command prompt it just don’t get’s open the locker and ask again and again for password even though i am giving a right password. how to get my data back ? tq

  176. This works perfectly for Network security. All you have to do is severely limit access to the .bat file with the security settings and it’s a very effective tool for keeping department document’s secure on the fly… of course the group security policy is more thorough… but if you just want to lock out one document temporarily this is very handy. Thank you!

  177. Hi. Very long procedure and you must remember all step as well as the bat file detail. but its work so not bad.

  178. hey Startkala2011…need not go that far……………just say dir /ah and you will get that folder listed and say “attrib -r -a -s -h” and your folder is unlocked……………..

    this is not folder security. this is cmdline security..that’s it.

    1. Can hide the file from yourself in security change permissions when you want to use This is only basic for people with limited compknowledge to be able to not just simply double click to find something you dont want them to

  179. First, thank you, it may not be fool-proof, but it is simple and effective, just in case someone opens my “hidden in plain sight” folder, but can you chain this to have different passwords in different folders that are in the original pw protected folder?

  180. this method did not do anything.
    i opened my folder and the private folder but none of them asked for a password

  181. It is good, but user can see the folder and nested files if he types in search bar.
    Then what could the solution for this.

  182. This method does not work for me. I created the locker.bat file as instructed. When I double-click it, a cmd screen flashes very fast, but I can see that it says “Private Created Successfully”. However, the Private folder is never created. If I right-click on locker.bat and run as administrator over and over, the script seems to be functioning in that it allows me to lock and unlock the “folder”, which does not exist.
    Can someone please let me know what is missing? I’m running Windows 7 – 64.

  183. i follow the instruction but i can’t do that.
    do you have more ideas on how to protect my files in a folder?…help..

  184. haha it was good , but if you leave the password like 123456, and if you try to unlock with any number you can unlock 654321 5256325 52425 what you want to write that will be unlock, doesnt good work .

  185. I want to delete the locker bat and private file but my computer won’t send all the files to the recycle bin. The few files it does send cannot be emptied from the recycle bin afterwards. How do I get rid of all files, the locker. bat and the private folder from my computer?!

  186. This code,because the original said that the Control Panel file didn’t exist for me,will allow you to Lock with Y, End with N,and Unlock with T. Just like the original,replace PASSWORD_HERE with you password.

    title Folder Private
    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
    if %cho%==T goto UNLOCK
    if %cho%==t goto UNLOCK
    echo Invalid choice.
    goto CONFIRM
    ren Private “Private”
    attrib +h +s “Private”
    echo Folder locked
    goto End
    echo Enter password to unlock folder
    set/p “pass=>”
    if NOT %pass%== PASSWORD_HERE goto FAIL
    attrib -h -s “Private”
    ren “Private” Private
    echo Folder Unlocked successfully
    goto End
    echo Invalid password
    goto end
    md Private
    echo Private created successfully
    goto End

  187. it is good but i have some problem in this case .i.e bat file is deleted so how to get the my folders please give me suggestion

  188. Is there a way to make the password hidden and show up as * for example if the password were Password it would show up as ********

  189. PLEASE HELP!!!! Do you know what do to if you forgot the password and can’t find the “locker.bat” file? PLEASE HELP!!!!

  190. i accidentally deleted the folder and locker can u help me to restore it coz i cant see the files on recycle bin, please help me