Thursday, March 18, 2010

Locking a folder with password by a batch file

Many of U might have a sibling who always uses your computer. Sometimes it becomes irritating if U write a diary on your computer. He/She might read it and chances are publish it on Facebook™ or Twitter™.
So what can U do 2 stop this? Well U can download a free encoding software from D net 2 password protect your folders and even zip them. (U can password protect a zip file or even a pdf file)
But downloading a free software is somewhat risky nowadays. I'm not scaring U in anyway but that what I've suffered. Also if someone sees such a software on your computer then chances R they'll know 4 sure that U R hiding something. So D solution is 2 hide a folder without any software.
Here is a batch file that hides your files & U have 2 enter a password 2 get them back.
Open Notepad
title Secret Folder
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
echo Are you sure u want to Hide 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.
ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
echo Enter password to Unlock folder
set/p "pass=>"
if NOT %pass%== mypassword goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Secret
echo Folder Unlocked successfully
goto End
echo Invalid password
goto end
md Secret
echo Folder created successfully
goto End
Change mypassword with your password.
Save it as nothing.bat or something (remember to select all files & save it with a .bat extension)
All done, now when U double click on this file, a folder named Secret will B created. Add all your files that U want 2 hide in it & then double click on D bat file. It'll ask U if U wish 2 hide Secret folder. Type Y for yes and N for no. Once hidden if U want 2 get back your files then double click on the bat file again, it'll ask U 2 enter a password, enter D password that U placed in it & your Secret folder will appear.
P.S.- I've not written this file myself, I got it from D net. But I have tested & use this batch file, so I'd say it works great. Soon I might add some changes 2 it & post it again.

No comments:

Post a Comment