How To Password Protect Any File Using Notepad

By | November 11, 2023

How To Password Protect Any File Using Notepad

Having a password for unlocking a windows PC is simple these days.and it is actually done by everyone. But what if i say we lock a folder by keeping a password. yes, if you need to see that folder , then you need to input password and later you can access the contents of the folders. so here in this article i will tell you  the whole process using notepad. You just need to follow these steps and you will know How To Password Protect Any File Using Notepad.

Steps to password protect any file using notepad:

 

Step 1:

First of all, you have to open notepad and copy the following code below and you can change the password with your desired one you just need to edit this line “if NOT %pass%== Infogalaxy goto FAIL” . You can replace “Infogalaxy” with your password.

@ECHO OFF

title Folder Private

if EXIST “Infogalaxy 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 Private “Infogalaxy Locker”

attrib +h +s “Infogalaxy Locker”

echo Folder locked

goto End

:UNLOCK

echo Enter password to unlock folder

set/p “pass=>”

if NOT %pass%== Infogalaxy goto FAIL

attrib -h -s “Infogalaxy Locker”

ren “Infogalaxy Locker” Private

echo Folder Unlocked successfully

goto End

:FAIL

echo Invalid password

goto end

:MDLOCKER

md Private

echo Private created successfully

goto End

:End

 

How To Password Protect Any File Using Notepad

How To Password Protect Any File Using Notepad

Step 2:

Now save as Folderlock.bat file.

How To Password Protect Any File Using Notepad

How To Password Protect Any File Using Notepad

 

Step 3:

You have to run that Folderlock.bat file at the saved location, now the folder named private will be created.

How To Password Protect Any File Using Notepad

How To Password Protect Any File Using Notepad

Step 4:

Now copy your files which you want to lock with password to private folder and then again run Folderlock.bat file and it will ask you “do you want to lock (Y/N), then type y and then hit enter.

How To Password Protect Any File Using Notepad

How To Password Protect Any File Using Notepad

Step 5:

After typing y and hitting enter, private folder will get hidden.

How To Password Protect Any File Using Notepad

How To Password Protect Any File Using Notepad

Step 6:

Again run Folderlock.bat file and it will ask you password which you have given, type it there your password and unlock your files.

How To Password Protect Any File Using Notepad

How To Password Protect Any File Using Notepad

That’s it. Now you can lock any file or folder using notepad.

We are on Facebook, YouTube, Google+

Author: MohitPatel

He is Tech Savvy. He loves writing on some topics. He loves android. Loves coding because coding gives u everything at your fingertips. Loves to be under the spotlight. And yes his middle finger always salutes to negative people around him..