30 July 2011

Lock and Hide Your Folders with Notepad..

How can you lock a folder and prevent others from accessing it? You don't need any software for that. Just no of lines  typed in a notepad Will do that for you.
Lets Start..
1- Open notepad from your start menu.
2- Type or copy and paste this code

title Folder XXX
if EXIST "Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}" goto UNLOCK

ren XXX "Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
attrib +h +s "Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
echo Folder locked
goto End
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%== 12345 goto FAIL
attrib -h -s "Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
ren "Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}" XXX

echo Folder Unlocked successfully
goto End
echo Invalid password
goto end
md XXX

echo Private created successfully
goto End

3- save as lock.bat  (you can use any name, but extension must be .bat)
Replace that xxx with the folder name that you want to lock.
Replace 12345 with your own password for unlocking.
This will make your folder as my computer shortcut and if somebody try to open it, it'll directly go to my computer and show hard disks and dvd/cd drives.