Welcome to just another day at "AARAMBH"!!! Get Daily Updates right into your Inbox for Free.

How to Lock Files and Folders without any Software

If you're new here, you may want to subscribe to my RSS feed or get daily updates via E-mail. Thanks for visiting!

Each one of us must have tried many softwares for locking their private files and folders. Few must have bought a licensed copy of one while others are better of using a free version. However, you can achieve the same level of privacy without any software. This tutorial will make things crystal clear of what I am trying to say.

Few months back, Madhur had written a similar article on locking folders without any software but this article is a step forward to what he has described at that time. The trick which I am going to tell here will make a virtual folder by the name “Locker” where you can put as many files and folders you want and after locking, this “Locker” folder will disappear.

Here is step-by-step guide to achieve that.

1. Download or Copy the following text file which contains the program code:-

Text File -> LockCode.txt

2. Paste the above code in notepad or create a new text document by right clicking on your desktop and selecting New->Text Document.

3. Replace “type your password here” with your password in the code you just pasted on the notepad. DON’T FORGET THIS.


4. Save the above file as BATCH file (by extension .bat). Choose any filename but make sure that it ends with .bat
(Open My Computer. Goto Tools -> Folder Options -> View. Scroll down and UNCHECK Hide extensions for known file types. Now rename your file with .bat extension)

5. Now you can see a MS-DOS BATCH file you just created. See the picture below:-


6. Double click on it to create a new folder named “Locker“.

7. Now put all files and folders you want to protect in to this new folder “Locker“.

8. Double click that BATCH file again to lock the folder “Locker”. It will disappear as soon as it gets locked.

9. If you want to unlock that folder, double click the BATCH file again. You will be prompted for the password, enter the correct password and that folder “Locker” will then be appear which is easily accessible by you.

That’s it. You are done. You have just learnt how to protect your important files and folders without any software. Isn’t it amazing? What’s your take on this? Do you know any other technique?

Update:- As pointed out my Mayank in the comment section, the safety of that BATCH file is also very important. So it’s better that you store it in some other directory or completely remove it. Then later on when you want to unblock your files and folder, just copy that batch file to same directory as your “Locker” folder and follow the above mentioned process.

If you like this article and want to get daily updates, do subscribe to my RSS feed or get daily updates via E-mail.

54 Responses to “How to Lock Files and Folders without any Software”

  1. Nirmal says:

    Nice tutorial, I feel this is best than using softwares. Stumbled.

  2. Keshav Khera says:

    I think this is the coolest of tutorials. Thanks a ton dude! you rock.

  3. Cool tutorial man! This can be pretty useful to hide a lot of files. Personally I am still more comfortable with the established methods such as encryption etc.
    BTW are you sure that these hidden files will not be accessible in any scenario such as from MSDOS, Linux etc ?

  4. ReviewSaurus says:

    Just ensure that you keep that batch file safe and delete it everytime once you lock it… else, it’ll be damn simple to crack the password too!

  5. Rakshit says:

    Thanks for the stumble. It’s good that you like it.

    Buddy, those are real good words. I appreciate that.

    Yea, softwares do provide an extra touch to your privacy by those encryption algos. I tried to access that “Locker” folder from DOS, but failed to do so. I did not even find it.

  6. Rakshit says:

    Thanks for reminding us about the safety of the batch file. I almost forgot to mention in my post. I am going to edit that right now.

  7. Rakshit: That’s good that it is completely hidden in other OS as well :) . Keep up the good work to share the original things like this one :)

  8. Rakshit says:

    Thanks Jawwad. People like you who are frequently commenting on my articles are the real source of inspiration for me. Thanks.
    Stay Tuned…

  9. Thanks for the link rakshit. This trick is cool.

  10. Rakshit says:

    You’re welcome, Madhur. It’s good that you like it.

  11. Ashfame says:

    Good tutorial. Can you please explain how it locks the folder?

  12. Rakshit says:

    Ashfame, just drag and drop any folder or file inside the “Locker” folder. That’s it. Whatever is inside that Locker folder is safe and protected.
    Hope it solves your problem.

  13. Ashfame says:

    I mean to ask how this whole thing works?
    P.S. I am not asking the explaination of batch file, I have already gone through it. I want to know how it becomes protected?

  14. Rakshit says:

    I am very sorry, Ashfame. I misinterpret you.

    What it does is that at first the given code creates a new folder named “Locker”, changes that folder into control panel with hidden attribute. That’s it.

  15. Ashfame says:

    Ok. I got the point.

  16. [...] How to Lock Files and Folders without any Software [...]

  17. JJSSKK says:

    Hey thanx for the effort but its not working for me when i try to lock it it says are you sure i write y then a file named x is created but nothing is hidden anfd thats it

  18. Rakshit says:

    Hope you have not altered the code by any means.
    Also, check that the batch file created after renaming looks same as shown in above picture.It should be something like “MS DOS Batch” file.\

  19. aditya says:

    i jus wanna ask that everything goes fine uptil the creation of folder named locker but it doesnt get lock ,on clickin y nothin happens

  20. Rakshit says:

    Ohh Aditya, I got your problem. Actually it was my mistake. There was a slight problem with the code in relation to Double Quotes (“”). It’s just when you copy and paste the content, the type of double quote gets changed.

    Anyways, I have updated that lock code. Try the steps again, you’ll get the results. If you face any problem, do let me know.

  21. Suryaveer Chauhan says:

    Hello Friends,
    A good technique to lock the folders without any softwares. Another good idea to destroy the “.bat” file for security reasons. But, one(with little knowledge of computers) can easily open that folder without any password. Even from command prompt. This how it can be done:
    Step 1: From My Computer goto Menu>Tools>Folder Options
    Step 2: Click on View tab.
    Step 3: Check th radio button which says “Show hidden files and folders”. Also, uncheck the checkbox which says “Hide protected operating system files(recomended)”.
    Step 4: Press apply ok.
    Now you can see the “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” folder with the control panel icon.
    Double click it. You will see the control panel window.
    Step 5: Rename the folder. Give any name.
    That’s it. You have unlocked the folder. The icon of the folder will be the same as normal folder.
    Now you can access the folder and its contents.

    From command prompt also u can access the folder. This is how it works:
    Step 1: Goto C:\ prompt.
    Step 2: Type dir /AH.
    Step 3: You can see “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” folder in the list.
    Step 4: You can get inside the folder using cd command.
    cd Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}
    Step 5: You can copy the contents of the folder to any desired place.
    You cannot rename the folder from command prompt.
    All this is done assuming the folder you created was in C drive. You must be thinking how a person is going to know that folder is created in the c drive.
    You are right but the thing is that one can search for the “Control Panel” folder or just hidden folders and can do all of the above steps. The unusual thing about the process of locking the file is that the “Control Panel” folder does not exist in C: drive or inside any other folder.

  22. JSK says:

    am sorry man but i forgot to enter my password cause i was in a hurry what can i do???

  23. JSK says:

    thanx alot i figured it out

  24. Rakshit says:

    Thanks for your valuable comments. I agree this is really a loophole in this technique. But yes, you can use it to protect your less important files.
    Nothing is secured these days.

  25. dhandeep says:

    gr8 man its superb
    i didnt think a batch file can do that
    its not the batch
    but u who has done it

    1 more thing
    can we make dilog box that pop out
    i want to show text while double clickin the batch
    thankx in advance

  26. Rakshit says:

    Dhandeep, what you are suggesting is a very good option to incorporate in the batch file coding. Right now I am working on it and will let you know when I get around it.

    So better Stay Tuned!!!

  27. . Jerry C. says:

    I created this Locker folder on share drive but when I went to access it from another computer it doesn’t open the Locker folder all it seems to do is display the control panel if run the batch file again it asks if you want to lock it again so it seems I can only access the unlocked folder from the computer I created it in. Is there something I can add to the script to change this
    Thank you

  28. Amol says:

    Thnx Dear,
    Nice utility

  29. Rakshit says:

    @ Jerry C.

    Just copy the LOCKER folder and BATCH file to another computer LOCAL DRIVE and then try running batch file to unlock locker folder. It should work pretty fine.

    Reply me back if problem persists.


  30. . Jerry C. says:

    Yes I tried that before I wrote to you and as I mentioned all that comes up is the the control panel icon instead of the Locker folder with the prompt “are you sure you want to lock the folder” after that. If I go back to original computer I can pull it up. This is a share drive but I tried from my laptop sitting right next to my desktop both connected to the same share drive I tried it from the other to test it so when I am at a users desk I can access the drive then the hidden folder but so far I cant do it
    thanks in advance

  31. Suryaveer says:


    Try renaming the control panel icon as Locker. It should work.

  32. . Jerry C. says:

    Thank you I will try that but from the other computer not the one I created it from the locker folder does appear but so does the control panel So I tried moving the control panel file in the locker folder going through the lock process again and it just gives me the open locker folder with the control panel in it. Back at the other computer, the one I created it on, it works normal. Very strange

  33. Leslie says:

    I have been looking for this tip because I used to working on public computer. But, just now I realized that you wrote this in your blog.

  34. Pras says:

    hi all
    i have a problem
    i created a lock batch file and in turn it created a locker file..then i copied my files into it and locked it. but now when i try to open it shows a control panel icon with locker as its name..i tried everythin said by Suryaveer but it doesnt work..pls help

  35. Suryaveer says:


    Try executing the batch file again. It will ask for the password. I think u must have done this. But this is all what I can say.
    Check one more thing; r u renaming the correct control panel folder. I mean control panel folde will be created inside the drive which contains the batch file.

  36. 73_BRD says:

    The trick given is very simple to tweak. I’m using Vista Ultimate and I’ve tweaked the trick. Unhide the system protected folders and files and u can see the locker folder, get inside it delete the files or cut them, its really simple.

  37. zxr3009 says:

    Hi i just want to have a suggestion. because it is useless also because if you view the hidden folder or the control panel. blaahblaah. it use less also because if you want to raname the control panel. the folder will show

  38. mukunda says:

    i want all folders present in my drive, they all locked by any batch file code
    all folder at one time by extesion .{21EC2020-3AEA-1069-A2DD-08002B30309D}

  39. Aakar says:

    This idea is fine !! but it jst hide the Folder and rename it as Control Panel…..But i can still open the folder by setting the view to show hidden files ….It doesnt even ask for password also….
    Can u guide me some better idea !!!

  40. kamal says:

    What about when someone try to access from CMD ???

  41. bobbycheung says:

    even if u do enter a wrong password it still lets u into it?
    ? is that a promblem? pls help!

  42. mAhAd3vA says:

    can’t use this wen u hav intelligent ppl around xD

  43. Bobby says:

    Cheers Rakshit. Works well!

  44. Romesh says:

    Thanks brother..it works perfectly…keep it up…

  45. Ishtiaq Ahmed says:

    Thankssssss Bro you are out standing. great great greatttttt work

  46. Ripon says:


    This is a very good post. And this helps me a lot.
    But could you please do one thing. How could we get the password character (exm.*) while typing the password? which will make this very helpfull.

    Thanks again.


  47. [...] NOTE: The LockCode.bat file MUST be in the same directory where the Locker folder was created originally for this method of locking files and folders to work. [via Rakshit Khare’s Blog] [...]

  48. [...] NOTE: The LockCode.bat file MUST be in the same directory where the Locker folder was created originally for this method of locking files and folders to work. [via Rakshit Khare’s Blog] [...]

  49. ranjith says:

    hi, this is was very useful. thanks

Leave a Reply

CommentLuv badge