Sunday, August 16, 2009

Lock Folder with Password without any extra(third party) Software !

step 1.
Save the following code with name AnyName.bat

-----------------------------------------------------------------------------
Start copy from the next line(Without this line) ->

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 and 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%==mamun 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

<- End copy before this line (Without this line)
-----------------------------------------------------------------------------
Step 2 :
Copy this "AnyName.bat" file in your desired folder which you want to lock.Suppose,you want to lock your E:\TEST folder.Now just copy your "AnyName.bat" in the E:\TEST

Step 3 :
Double click on the batch file which will create a new folder named "Locker".Now put all the file or folder in this "Locker" folder.

Step 4:
Now again double click on the batch file and it ask you are you sure...Then just press y and then press enter and notice that the locker folder already hide...lol...is it not interesting?..

Retrieve the locked file :

Now if you want to retrieve that then just double click the batch file and give your password which you enter to the "AnyName.bat" file.And now you can see the hiden file "Locker".In this code,I give mamun as password.So if you don't change code, then just double click on the AnyName.bat ,give mamun as password and see that, your locked folder "Locker" already visible.But if you don't know password, you can't see that folder.

****************************************************************************
-----------------------------REMMEMBER ------------------------------------
*****************************************************************************

You have to memmorize or write some where that,what the location where the "Locker" folder was locked.And when you retrieve ,put the "AnyName.bat" to that location.Suppose,for the above example,You have to memmorsie the location "E:\TEST" and put the bat file to this "E:\TEST" location for retreive.

Ok hope you will enjoy !!

No comments:

Post a Comment