Hide Your Secrets: How to Password-Lock a Folder in Windows 7 with No Additional Software

How to Password-Lock a Folder in Windows 7 with No Additional Software

Today's guide is on creating a password protected folder on Windows 7 without any additional software. Yes, you heard that right. No extra software at all! This guide is intended for beginners. But please note, this method should not be used to store financial or otherwise highly confidential material. It might be a good place to hide a planning document for a family member's birthday party or similar occasion where you need to keep something secret temporarily.

How to Create the Password Protected Folder

The first thing you should do is go into "Documents" and create a new folder. Name it whatever you like.

Hide Your Secrets: How to Password-Lock a Folder in Windows 7 with No Additional Software


When you have done that, double-click on the folder and create a text document. This can be achieved by going into the contextual menu (right-click anywhere inside the folder -> New -> Text Document). Double-click on the text document and paste the following code into 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 Private "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%== PASSWORD_GOES_HERE goto FAIL
attrib -h -s "HTG Locker"
ren "HTG Locker" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End

The next step is to change the PASSWORD_GOES_HERE text to whatever you'd like your password to be. Don't use an easy-to-guess password.

Now we need to save the text document.

Hide Your Secrets: How to Password-Lock a Folder in Windows 7 with No Additional Software

NOTE: The text file must use the .bat extension. Therefore, I have named it locker.bat and saved it as a batch file.

Hide Your Secrets: How to Password-Lock a Folder in Windows 7 with No Additional Software

When you have saved your batch file, you will need to delete the text document (.txt).

When you have deleted it, you may now double-click on your batch file. The first time you run the program, it will add a folder titled "Private". This is where you can store your documents to keep away from praying eyes. Go ahead and put some stuff in it now. 

Hide Your Secrets: How to Password-Lock a Folder in Windows 7 with No Additional Software

Above is a picture of the "Private" folder and "locker.bat".  

When you have finished adding your documents to the Private folder, double-click on locker.bat.  You will now be prompted whether you wish to lock the document or not. Select "Y" to lock it. When you do this, you will notice that the Private folder quickly disappears.

Hide Your Secrets: How to Password-Lock a Folder in Windows 7 with No Additional Software

When you double-click locker again, it will ask you to enter the password.

Warning!

  • This is NOT the place to store confidential information, such as medical records, financial information or passwords. This is not the best place to hide things from an IT professional, but it should work against newbies or people with intermediate computer skills.

How Do You Bypass It?

Go into Folder Options -> View -> and uncheck "Hide protected operating system files".

Hide Your Secrets: How to Password-Lock a Folder in Windows 7 with No Additional Software

However, when they attempt to un-check, it they will get this warning which may make them think twice before disabling it.

Hide Your Secrets: How to Password-Lock a Folder in Windows 7 with No Additional Software


Credit: We found this script on many different websites going back years and years and have no idea who made it. If you have proof that you originally wrote the script, please get in contact with us and we will amend the article accordingly.

Just updated your iPhone to iOS 18? You'll find a ton of hot new features for some of your most-used Apple apps. Dive in and see for yourself:

Photo by gizmowatch

34 Comments

Nice tut. This will never work on my system though as I have system files, hidden folders, and file extensions enabled.

Ha-ha. Well in that case, you will either need to disable them, otherwise use a proper encrypting program such as TrueCrypt or Axcrypt for your really sensitive files. But I'm sure you already know that! Thanks for commenting :-)

this only hide files. Beter use a soft like winsesame to ENCRYPT data.
sergio

hHa-ha. Well in that case, you will either need to disable them, otherwise use a proper encrypting program such as TrueCrypt or Axcrypt for your really sensitive files. But I'm sure you already know that! Thanks for

Tnx, this has helped me a lot
It's just the right thing for me to keep my files safe :D

how to remove this password , i forgot my password and i need my file :(

Just use the technique above
Or keep the password safe
Or make a duplicate folder before locking it
:)

Open the locker.bat file with notepad and change the password. it's as simple as that :)

this really helps but the problem is when we put password to open the .bat file,the password is shown in plain text and everyone can see it and it becomes unsecure. now my question is, how can we encrypt the password so that no one can view my password? what are the codes to be added in the .txt file? please help out.............

You can achieve the bat file to the winrar application and create password before you extract.

this fails, you can just right-click the bat file and see the password..

can u change this?

So, I forgot the password to a locker that was on an old laptop that I thought died when I spilled juice on it--but it came back to life; yet the tutorial for bypassing the locker does not work:

enabling hidden protected files does not show the locked folder at all; and to the man who said you can right-click the bat file to see the password: no, you can't as I tried that as well.

if the somebody delete the locker file then, any way to get our data back?

it is good but somehow fails .... i am agree with rick u can just right click and then edit to see the password....

and one thing it just hides the stuff we put there nothing else ...we can find them by simple search options.......but i want to ask how that by-pass thing works ????

if we delete thelocker bat file,then how can we get the files we hidden

So, first off thanks, I have used this and it works fine as no one that would I want to keep the files from are advanced enough to hack the lock.

Somehow I did however forget my password so I tried the fix above.

Go into Folder Options -> View -> and uncheck "Hide protected operating system files".

This as someone else suggested did not work, it did not display my 'private' folder. I did however right click on the bat file as also suggested and once you click on edit you can see the password so again great solution not foolproof but no MIT persons around my house so works for me!!

It is good creation for every one....

hi,

i want the password entered in it to be as n not as text n if i have forgotten to lock it after restarting of my system the folder should get locked automatically...how to do so...

HI there, here is nice video on "How to lock folder without any third party app on windows 7"

Well this is good to stop little kids from watching you're... well... uhm... private videos and pic, or some below average user from looking at you're stuff in that folder. It is way too easy to bypass this security, you can easily search for the file or files from search bar in windows explorer (explorer will find them, you don't need to know the name of file you can just type the extension in search bar) or you can rightclick the the batch file and go to edit, there you can see the pass. Is there a way to hide files from explorer's search and hide folders from view even if the ''show hidden files'' option is enabled?

Converted the batch file to exe.. works perfectly

This only hides the file and renames it...but Is there a way the file can be really locked that it wont be opened even if hidden files are enabled without a 3rd party application?

This is GARBAGE....

It does absolutely nothing at all, but create a folder called private that does NOT disappear when you so called "lock" the folder??

I am not sure where you found this code, but it is completely useless!!

Encryption is your friend... and it's free. You have "show hidden files and extensions" enabled.?

You can make a Folder Maze. Old FTP Trick.

hello, I went through all the steps but it still doesn't require password to open the folder!! plz HELP

It doesnt work!

All it does is create this folder called HTG Locker whenever i try to lock it and then you can continue seeing the contents of the folder as it is! :/

Plz Reply this............
Can u tell when the files are hidden, where the files go? are the files saved in Windows folder? Plz tell me

I tried to lock my hard disk drive with this locker.bat but now i am unable to recover my data. Can anyone tell how to recover urgent

Share Your Thoughts

  • Hot
  • Latest