How to Lock a Folder

Attention Before you read this post, I highly recommend you check out my resources page for access to the tools and services I use to not only maintain my system but also fix all my computer errors, by clicking here!

When it comes to locking a folder, there are a number of methods that you can use; the vast majority of these methods require you to at least use some kind of third party application. However, if you would like to know how to lock a folder using purely manually methods, then you have come to the right place.

It’s more important you know that the methods outlined below, though very good, can be undone by an experienced computer user.

Note: If you’re a beginner these methods on how to lock a folder will likely be too advanced for you. The likelihood is that you may incorrectly lock your folder(s) and lack the expertise to recover them. I don’t want you to be that person, so make sure you feel comfortable with the various steps, before making any attempts to do them.

Things to Consider

  • It’s not possible for you to lock a folder 100%. There are tons of tools and applications that teach individuals how to break the encryption on locked folders. However, the methods outlined below, will be sufficient in securing your folder(s) from the vast majority of people you are likely to encounter. If the information you want to lock is extremely important to you, then I suggest you consider using a commercial product.
  • Even after you have locked a folder, it is still possible for it to be deleted (unless you use a program that prohibits users from deleting your personal data). For best practice purposes, it’s recommended that you backup your files, prior to utilising any encryption or locking methods.
  • If you forget the password that you used to lock your folder, unless you are willing to spend a considerable amount of time breaking the password, the likelihood is that you will have lost your data. However, this only reigns true with the commercial tools, the methods I have outlined below, have workarounds, which prohibit such punitive results.

How to Lock a Folder Using a Password

When it comes to the various methods you can use when you want to know how to lock a folder, this one in particular involves creating a batch file to unlock or lock a folder, containing important data. Anyway, to do this, simply do the following:

1. First, boot into your computer with full administrative rights.

2. Then press windows key + R type and click on OK.

open my computer using run command box

3. Once My Computer [Windows Vista/7/8/8.1/10: Computer] loads up, double click on your C: Drive.

Double click on drive

4. This will take you to your C: Drive, from here, right click and select New -> Folder.

Select new -> folder

Note: This folder will be the location where you will create your secure folder; alternatively, you could simply navigate to My Documents or some other area on your hard drive.

5. Name the Folder, and then double click on it, to enter it.

Give folder a name

6. Once you’re inside the Folder, right click and select New -> Text Document.

New -> Text Document

7. Don’t name the Text Document, instead open it, then copy and paste the following into it:

cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Are you sure u 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 Locker "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 folder
set/p "pass=>"
if NOT %pass%==mypassword goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Locker
echo Locker created successfully
goto End
:End

8. Then put in your password, by replacing mypassword (from the text above) with whatever you would like your password to be.

change mypassword to your password

9. Then save the Text Document as locker.bat, make sure Save as type is set to All Files.

save -> locker.bat

Note: If this leaves you with an additional Text Document file (since you ONLY want the locker.bat file) in the folder, simply delete it, by right clicking on it and selecting Delete.

10. Once you’ve done that, double click on the locker.bat file, to create your new secure folder.

create folder -> double click on locker.bat

11. Then copy and paste your personal files into the Locker folder.

cut and paste files to Locker folder

12. Once you’ve done that, double click on the locker.bat file again and a Command Prompt should appear asking you are you sure you want to Lock this folder, simply type Y and press Enter, and your folder will be locked.

are you sure you want to Lock this folder -> Y

13. To unlock your folder, simply double click on the locker.bat file and enter your password.

unlock folder -> password

Note: For security purposes, it’s very important that you cut and paste the locker.bat file to somewhere secure, like a USB stick. That way, users of the computer system will remain unaware of the hidden folder.

If You Forget Your Password

If you, for any reason forget your password, you can retrieve it by doing the following:

1. Right click on the locker.bat file and select Edit.

locker.bat -> edit

2. Then navigate to the echo Enter Password to Unlock Folder portion of the code to find your current password. Alternatively, you could change it to something more memorable.

echo Enter Password to Unlock Folder -> mypassword

3. If you decide to change the password, make sure to click on File -> Save.

file -> save

How to See the Folder

This lock method works simply by changing the attributes of the folder to a system file when invisible and a normal file when visible. When looking at methods on how to lock a folder, this is probably not the most foolproof, this is becuase it is possible to make all system files visible. To do this, simply do the following:

1. First, boot into your computer with full administrative rights.

2. Then press windows key + R type and click on OK.

open my computer using ...

3. Once My Computer [Windows Vista/7/8/8.1/10: Computer] loads up, click on Tools -> Folder Options [Windows Vista/7/8/8.1/10: Organize -> Folder and search options].

Organize -> Folder and search options

4. When Folder Options loads up, click on the View Tab, then scroll down and uncheck the box next to Hide protected operating system files and click on OK.

view -> Hide protected operating system files

Note: A warning notification box will appear; you will need to confirm the change in order to uncheck the box.

notification warning -> yes

That aside, it’s not recommended that you make protected operating system files visible, as you can very easily corrupt your operating system.

Second Folder Lock Method

If you want to know how to lock a folder, there are a lot of tools available that the end users can download and use for the purpose of locking or securing a folder. Despite that fact, it is possible to do it manually, as I have shown above. However, the method below works slightly different, and is easily the simpler of the two methods, so it could prove to be a viable alternative for most. Anyway, how to lock a folder using this method, is fairly simple, just do the following:

1. First, boot into your computer with full administrative rights.

2. Then press windows key + R type and click on OK.

open my computer using run command box

3. Once in My Computer [Windows Vista/7/8/8.1/10: Computer], double click on the Drive you would like to establish this folder in.

Double click on drive

4. Then right click select New -> Folder.

Select new -> folder

5. Name your Folder. For maximum effectiveness its best you give the folder a similar name to a component that you would find in the Control Panel.

Give new folder a name

6. One you’ve done that, right click (outside the folder) and select New -> Text Document.

New -> Text Document

7. Open the Text Document and copy the following into it:

ren Mouse Mouse.{21EC2020-3AEA-1069-A2DD-08002B30309D}

8. Then save the Text Document as loc.bat, making sure Save as type is set to All Files.

text document -> loc.bat

9. Now create another Text Document using step 6 and copy the following into it:

ren Mouse.{21EC2020-3AEA-1069-A2DD-08002B30309D} Mouse

10. Save this Text Document as key.bat, making sure Save as type is set to All Files.

text document -> key.bat

11. Once you’ve done that, you can now Cut and Paste your important data to the mouse folder.

Folder -> Paste

12. When you’ve done that, simply double click on the loc.bat file, to lock the folder.

loc.bat -> lock folder

Note: the loc.bat file will alter the icon of the Mouse folder and redirect anyone that clicks on it to the Control Panel.

13. To gain access to the folder, simply double click on the key.bat file.

key.bat -> unlock folder for How to Lock a Folder

The key.bat is the unlock file, so that’s the only file that you will need to keep secure. Consider copying it to a USB drive or CD, that way, whenever you want to access the folder again, all you need do, is copy over the key.bat file and double click on it.

Are you looking for a way to repair all the errors on your computer?
Advanced System Repair Pro image

If the answer is Yes, then I highly recommend you check out Advanced System Repair Pro.

Which is the leading registry cleaner program online that is able to cure your system from a number of different ailments such as Windows Installer Errors, Runtime Errors, Malicious Software, Spyware, System Freezing, Active Malware, Blue Screen of Death Errors, Rundll Errors, Slow Erratic Computer Performance, ActiveX Errors and much more. Click here to check it out NOW!

Leave a Comment