Sunday, August 28, 2016

How To Password Protect A Folder Using Notepad

              Everyone has some private data to be secured at some point of time. Sometimes we have to share our laptops, desktops to our friends, relatives and neighbor’s it is important to lock that private data which we can’t share with them. There are various methods to password protect folders/files using third party software’s. But now this post will show you how to lock folders with password using Notepad and without any external software’s help.

Here is the procedure to lock your folder with a password

password-protect-folder
password-protect-folders


Step 1:

     Open notepad in your Computer.

Step 2:

notepad


Copy the below code as it is into notepad.

cls
@ECHO OFF
title Folder Lock
if Exist "folder" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Are you sure want to lock your 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 "folder"
attrib +h +s "folder"
echo Folder locked
goto END
:UNLOCK
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%==1234 goto FAIL
attrib -h -s "folder"
ren "folder" Locker
echo Folder Unlocked succefully
goto END
:FAIL
echo Invalid password
goto END
:MDLOCKER
md Locker
echo Locker created successfully
goto End
:End

Step 3:
Now replace “1234” with your own password in the line
if NOT %pass%==1234 goto FAIL

replace-code

Step 4:

Save notepad as “folderlock.bat” and change Save as type to “All files”.

save-batch-file


Step 5:

Now a batch file has been created with the name folderlock
Double click on batch file so that a "Locker" named folder will be created.

batch-file


Step 6:

Copy files into the "locker" folder which you have to keep secured.

locker-folder


Step 7:

And again double click on folder lock batch file.
Now command prompt will ask you to “Are you sure want to lock your Folder(Y/N)
Now Enter “Y” if you want to lock else “N”

to-lock-y

Your folder will be locked and hidden.


Step 8:

To unlock your folder again double click on you folder lock batch file
Command Prompt will now ask you to” enter password to unlock ”.

Enter your password to unlock.


password-to-unlock


Don’t forget to save your locked files other than Installation drive because if your operating system get crashed you may lose your data.

If you like my trick please do share, like and subscribe for more. 

0 comments: