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,
@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%== 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
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Locker
echo Locker created successfully
goto End
: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.
this doesnt work
the locker can be opened by any entry
It works fine…still I knew that from before…
No my dear, it works fine on my computer. You may have accidentally done something wrong. Did you read that “Important Note” properly?
cannot unlock it…
where did it ask to set a password??
To unhide, double click protect.bat, type in your password and press enter…
Nice! Thanks for the code.
Will this locker locks the folders in the USB also?
Yes, but you “have to” run the bat file to see that folder again.
Nice code. The best part is that it works for USB drives…
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!
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
http://gizmosnews.blogspot.com/
Yes, that can be done. I’ll post the modified source code soon. Thanks for the suggestion.
hey there no locker folder generated and i have read all the instruction carefully can u plz tell me reasn……
hey plz reply dear………
@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.
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?
@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.
It is not working. (including ** line) what is this whr i find ** in program?
@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.
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.
Thanks
Amit
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 :)
Use the command prompt to navigate to a locked folder :) This solution falls flat on its face :D
@CRACKED
Yes, the folder will appear on command prompt. But how will you determine “where” to see? Think about it.