February 11, 2012

Lock File(s) on Windows Without Using Any Software

How many times have you wished of a software using which you can hide or lock files,  restricting its access to other unwanted users. Although there are various software available in market using which you can easily lock/hide files but, i personally dont trust them because most of them are bloatware or spyware.

In this post i am going to share a simple yet powerful way of locking and hiding important files using a the following method. Follow the instructions to make you own Locker ( Without any software !! ) :

  • Open notepad.
  • Copy the following code in notepad file :

    cls
    @ECHO OFF
    title Folder Locker
    if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
    if NOT EXIST Locker goto MDLOCKER
    :CONFIRM
    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.
    goto CONFIRM
    :LOCK
    ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
    attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
    echo Folder locked
    goto End
    :UNLOCK
    echo Enter password to Unlock folder
    set/p "pass=>"
    if NOT %pass%==YOUR PASSWORD HERE 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
    :FAIL
    echo Invalid password
    goto end
    :MDLOCKER
    md Locker
    echo Locker created successfully
    goto End
    :End
  • Change the “YOUR PASSWORD HERE” with your password.
  • Save it as batch file ( with extension .bat ) For eg. Locker.bat
  • Now you will see a batch file. Double click it to create a folder locker ( A new folder named Locker would be formed at the same location )
  • Thats it you have now created your own locker and that too without using any software !
  • Brings all the files you want to hide in the locker folder.
  • Double click the batch ( As created above ) file to lock the folder namely Locker.

Folder lock

If you want to unlock your files, simple double click the batch file again and you would be prompted for password ( In DOS window ). Enter the password and enjoy access to the folder.

Share This Article With Your Friends!
 

Suggested Articles For You:

 

Sign Up To Get Latest News On Mobile Phones, Apps, Tips & More!

Free newsletters delivered to your Inbox!
You must click confirmation link sent in email. If you don't see the email, check spam folder.

Speak Your Mind

*

Comments

  1. ABHISHEK says:

    yep it’s Gr8

  2. jonel says:

    this is a great one.. its really useful your such a great.. thanks for sharing your knowledge with us

  3. adnaan says:

    tHIS doesn’t work for me

  4. MaK says:

    One way of avoiding change of password is if u rename the extension .bat to sys.. This way the person will not know this is the file to change.. Whenever you wana see ur files back, change it to .bat again, enter password, enjoy..
    However, it isnt very useful coz if we turn on the “show hidden files” from Tools->Folder options, The file pop up anyways.. Password.. Or no password..

    Regards…

  5. Ansfav says:

    Sir this is a nice one! Bravo!

    But,

    if the location of the batch file is simply where the file is, isn’t it a little too easy to anticipate for others to open the batch file and replace the password?

    i mean is there any way you could also lock the batch file? so it can’t be edited that easy?

    and is there any way we to hide the password as we type it? like asterisks? cause i can see it as i type it…

    • Paritosh says:

      You’ve pointed out the issues which would have been taken care of had this been a ‘real’ way to protect your files. What I shared above is just for fun!

  6. Michael Valdez says:

    This is totally awesome man. Thanx

  7. abhijeet says:

    thank!!! i realy need something simple like that….!!

  8. RAHUL RAGHUVANSHI says:

    HOW TO CHANGE PASSWORD …………IN THIS SOFTWARE

  9. dave says:

    it’s work great!!
    thanks very much for your great sharing :)

  10. Nick Jeoung says:

    Is there anyway to link this to the matrix code thingy that u mentioned in another post/
    btw. love this. works perfectly (perfectly enough for my purposes anyway)

    • Nick Jeoung says:

      by link i mean like if you put in the wrong password it opens the matrix code .bat file thing.
      hope thats clear enough to understand…..

  11. Riyas says:

    i hide my files with notpad but it not unhiding.

  12. peaceang says:

    to see the locked and hidden file, you just have to uncheck the ‘Hide protected system files(recommended) box in Folder Option

    you will see the file named ‘Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}’

    to see what in this ‘Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}’ file, just rename the file to anything you like

    you now can open the file and see what inside it

  13. John Smith says:

    This isn’t very secure. Someone could simply load the file into Notepad and change the password themselves.

    Cool trick though

  14. quickberry22 says:

    when i try to re-lock it a new folder comes up help

    • Paritosh says:

      That’s just a temporary folder that appears for a very short duration once you lock protected folder.

      • Shakir says:

        Dear Mr. Paritosh
        Hope you’ll be fine
        I have only one question regarding the lock folder without any softwere. Is it possible that when we are going to enter password and it shows only stericks (***) instead of alphabets

        Thank You

        Have a Great Day for You

        Shakir Afridi.

  15. unknown says:

    there is no point in this when hidden files and folders are shown.
    and u can doit in the control panel folder option>view tab …

  16. mohd. abid says:

    Coool trick bro…
    thnx.

  17. Siddharth says:

    This doesn’t work! It shows: Error code ’911′ Invalid character: 2 Line:2. Fucking Shit you wasted my life’s 5 minutes! Paritosh Sux!

    • Paritosh says:

      The code mentioned above is working perfectly fine. I believe you didn’t copy the entire code properly. And my friend you should first make sure you have done the things right before blaming others :)

  18. meer says:

    can we block the nst using notepad

  19. mustafe says:

    what about if some one delete my locker file that i made

  20. ali says:

    what if some one deleted the .bat file?
    and you can right click to the .bat file and change the password or see it. so whats the use of loking…?

  21. Redpy says:

    I think what red4oy is asking is if it’s secure being that all someone has to do is right click on the .bat file and click edit to see what the password is. Is there a way to keep them from doing that, which I doubt.

    • Paritosh says:

      It isn’t a secure way of hiding your data but certainly works. As far as editing of .bat file is concerned, you can make it read only and/or password protect it in a rar file.

  22. red40y says:

    cant you go in to edit the password you made? would this cancel the usefulness of the password altogether? is there a way to change this so you cant change the passcode you create?

  23. harsh says:

    thanks you so much bro. its work.
    is its fully save????
    plz tell me more tricks to how to unlock vista password. user password plz

  24. godsendjk says:

    It works perfectly fine…. However, what will happen if we delete the .bat file after locking the folder?? We won’t be able to retrieve the folder!!

  25. Happy :) says:

    This program works just fine i think u people may not have the file working on you’re computer because this file sometimes does not work on windows 7 and thankyou for the file

  26. Benji says:

    Alright, I got everything set up.
    But what am I suppose to do when I lock it up?
    It asks me if I want to lock it and then I type in “Y” but….nothing happened. So then I pressed “Enter” right after typing “Y” and still nothing changed.
    I double clicked on the batch file and it asked me the same question “Do you want to lock this folder?”
    lol….it’s trying to fool me I think….

  27. chav says:

    this didnt work when i tried as bat file ,but as a program file(.exe) said it was illegal so i give

    • Paritosh says:

      This works with .bat extension only. I have tried this and it is working though it doesn’t works on some machine’s running windows 7.