If you are wondering why should I know, How to protect a folder with a password using notepad, then you must know that the window doesn’t provide any option to lock your folder.
Also see this:-Top 10 Notepad tips & tricks that you should try.
But there is a trick where we can write a piece of code in notepad and use it to lock our folder with password.
Let’s have a look at it.
Table of Contents
Step:1 Click start and open Notepad. Copy and paste the code written below in your notepad.
@ECHO OFF
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
if NOT EXIST Private goto MDPrivate
:CONFIRM
echo Are you sure to lock this 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 “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 Your Secure Folder
set/p “pass=>”
if NOT %pass%== thebigcircuit FAIL
attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDPrivate
md Private
echo Private created successfully
goto End
:End
Step 2:
Here you can change the password(the big circuit) to any other password by changing it in the notepad file.
Here you can also change the folder name from Private to any other name.
Step 3:
Now you need to save the file with a .bat extension in my case I have saved it as lock.bat
Step 4:
Now click on the file name lock.bat (in your case whatever you have named it) to run the code.
Step 5:
Now you have to double click on the lock.bat file to create a folder where you will store your files which you want to protect.
After clicking on lock.bat file a folder would be create as shown in the image above. Where you can store your files.
Step 6:
Once you have saved all your files in this folder now you can lock this folder, you just need to double click on the lock.bat file press Y on the keyboard and hit enter. Remember that the folder would disappear when you press the enter key.
Step 7:
Now, whenever you need to access your files just double-click on the lock.bat file enter your password and press enter key.
That’s all you need to do to lock your files with password protection without using any software.