Scrolling Text

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks

Welcome to My Blog !

By : Nirdosh Dhakal
I'm, here at this regular post Free Software, Computer Problem Solving, Tips, Tricks & Tutorial. Various stuff to change Windows look & feel. In this article, I'm going to list some of my best and most exclusive articles for you. So take your time and make sure you haven't missed any of them?

18 September 2012

How to make a Locked Folder and set Password?

Following is the script.
copy and paste it in notepad and save it as *.bat (a batch file).
For layman... name the file as "run.bat" and save it where you want your folder to be.
E.g.: if you want your protected folder or Locked Folder to be in C:\ then save the file in C:\.
If you want your protected folder or Locked Folder to be in D:\New Folder\ then save the file in D:\new Folder\


Quote:

cls
@ECHO OFF
title Folder Briefcase
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Briefcase goto MDLOCKER
:CONFIRM
echo Are you sure you want to Lock 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 Briefcase"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 the folder
set/p "pass=>"
if NOT %pass%==pwd123456 HERE goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Briefcase
echo Folder Unlocked
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Briefcase
echo Briefcase created
goto End
:End


Note: paste the above code in notepad and go to Edit>>Replace... and replace "Briefcase" with a folder name of your choice and "pwd123456" with a password of your choice. If you use any new folder name which do not exist, it will create one.

How to use it...
To hide:
Run the .bat file, it will ask you for confirmation to hide the folder (Y/N), press 'Y' if you want to hide the folder and its done

To Unhide:
Run the same file again, it will ask for the password. Put in the correct password and your folder again shows up.


Pros:
1) easy to use
2) hides the content completely i.e., even Show Hidden Folders option enabled cannot show this hidden folder nor Windows search can search the contents of this folder when the content is hidden.
3) I never faced any data loss or anything.
4) even if you forget your password you can always recover it by reading the batch file you created.

Cons:
1) no encryption. therefore not advised for offices where data security is critical. In that case I suggest you to go for professional software.
2) Password can be hacked by any geek by reading the batch file.
3) It hides only 1 folder, for another folder you need another batch file.

lock folder 1
 lock folder 2
 lock folder 3
lock folder 4

lock folder 5
lock folder 6

lock folder 7
lock folder 8
 lock folder 9