How to Lock a Folder?

How to Lock a Folder?

Well certainly this is one of the most common questions we come accross every now and then.. We try to password protect our important files.. We all like to save our important file on our PC/Laptop such as our bank information, Business Files, Credit/debit statements, personal files etc.

[image credits-Google]

Now, as I have already show you earlier that you can use an Invisible folder to protect your files.. That is one of the methods but the problem with it is if indeed you place your invisible folder somewhere deep in your directory you may yourself end up forgetting the path as wont be able to access your files.. So why not just protect them using a password?

There are certainly many methods to password protect your files/folders but they all mostly involve the use of a third party software like rar etc. So lets just follow a very simple process instead for password protecting your files and folders.

Steps for Locking a Folder:


1- First you need to create a new folder and name it anything you like. For example I'm going to name my folder as "Important" in this example.

2-Now, Go to your new folder that you just created, "Important" in this case and there you need to create a new text document. [Right Click>New>Text Document]

3-Now you need to copy the following code and paste it in your text file.

title Folder Private 
if EXIST "HTG Locker" goto UNLOCK 
if NOT EXIST Private goto MDLOCKER 
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. 
ren Private "HTG Locker" 
attrib +h +s "HTG Locker" 
echo Folder locked 
goto End 
echo Enter password to unlock folder 
set/p "pass=>" 
if NOT %pass%== TECHINSENSE goto FAIL 
attrib -h -s "HTG Locker" 
ren "HTG Locker" Private 
echo Folder Unlocked successfully 
goto End 
echo Invalid password 
goto end 
md Private 
echo Private created successfully 
goto End 


Now change the TECHINSENSE part to your desired password. Once done go to the File tab on the top left corner and save it as locker.bat

4-Now as soon as you have created the locker.bat file... just delete the original text file.

5-Now double click on the locker.bat file and a new folder will be created called Private.

6-Now just move all your important stuff on the Private folder and close it and double click on the locker.bat file once again.. Now a new window will pop up asking whether you want to lock the folder, type "Y" and press Enter.

7- As soon as you press enter your folder will be locked and it will be gone.

8-Now in order to access your files you need to double click on the locker.bat again and it will ask your for your password. Enter your password and hit Enter and your folder will be back.

9-Repeat the same process again to lock/unlock your files.

Note- This is one of the easiest method to lock your files however the cache is someone who knows about the trick would be able to access your files easily as opening the locker.bat file as a text document would reveal the password however not many know of this. 

Do let me know in case of any queries in the comments section below :-)
Thank you!



Also Read

Invisible Folder Trick
Share on Google Plus

About Author: Abhishek Ghosh

I'm a Tech Blogger.. Electronics and Network Engineer.. Always interested in getting things done the hard way.. Stay tuned for all sort of tech and blogging queries.. reach me out on social media throught the Social box on the top right corner of the page.. Have a great day and stay Sensible.


Post a Comment

Sign Up for Email Updates