Thursday, February 19, 2015

How to Create a Password Protected Folder without any Extra Software



For example I have a important data in a folder in C drive which I want to lock it.

Open a notepad and paste the below given script in it.
_____________________________________________________________________
cls
@ECHO OFF
title Folder Private
if EXIST "HTG Locker" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo Are you sure you 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 secure "HTG Locker"
attrib +h +s "HTG Locker"
echo Folder locked
goto End
:UNLOCK
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%== iforgot@8 goto FAIL
attrib -h -s "HTG Locker"
ren "HTG Locker" secure
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md secure
echo secure created successfully
goto End
:End
________________________________________________________
3) Then save notepad file as .bat file For example: private.bat in C drive and close it.

4)  Now run your batch file by double clicking on it–the first time you run it, it will create a folder called Secure. This is where you can store all your secret things. When you have finished adding all your stuff to the Secure folder, run locker.bat again.

5) This time you will be asked if you sure that you want to lock the folder, press the “Y” key and hit enter to lock your folder.

6) You will see that your Secure folder quickly disappears.

7). If you run the batch file again, you will prompted for a password.

8) If you enter the same password as you set in the script the Secure folder will reappear if you enter the incorrect password the script will just Terminate.

If You Forget Your Password

Seems like once a week somebody writes in asking how to figure out the password they set. And the answer is really simple: Right-click on the locker.bat file and choose Edit.

Then you can see the password you set in the file.

No comments:

Post a Comment