8/30/2007

How to lock a folder without using any software ?

Got some personal data which you don't want to be accessed by others who use your PC ?? Looking for something that can lock your folders ? Normally you can find lot of softwares that can serve your purpose. What if you can make something for yourself to serve your purpose ? Here is something which I have to lock your folders.

Code :

cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303 09D}" 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%==type 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
Instructions :
  • Copy the above code in a notepad and type your password in place of "type your password here" which is marked red in the above code.
  • Now save the notepad file with name xxx.bat [ i.e with extension .bat ] .xxx can be any name.
  • A batch file will be created. Now double click on it . It will make a folder with the name locker at the same place where the batch file is saved .
  • Now add the files you want to be locked in that folder .
  • Double click on the batch file. It will ask for locking the folder . Type Y(yes). The folder will be locked and hidden .
  • To unlock the folder ,double click the batch file again and enter the password in the new window opened.
New to Five point someone ? Subscribe here or click here to get updates via email .

Thanks to Mr.Shubham.


4 comments:

this is useful. thanks for sharin.

Neat...

You might wanna fix a little typo in the code though;
The first reference to
"21EC2020-3AEA-1069-A2DD-08002B303 09D" shows a space in front of the last 3 "09D" characters, whereas future references do not.
If the code is compiled this way it will always re-create the "Locker" folder and the content will seem to be "lost forever". Eliminating that space fixes the problem...

However, my main question is: What will prevent someone from hitting the "edit"option on the batch file itself and seeing your password in the code...?

Cheers...

HZ01

Yes, you are right that if some one uses the edit command, they can see the password. But it will be better if this batch file can be converted to a COM file. That will be cool know.
Many free converters are available!!

How to undo this?

Post a Comment