When it comes to protecting your data on Windows 10, putting a lock screen password is the first thing you do. By doing that, you try to protect data stored in every folder on your PC. However, what if you have to hand over your system to someone else for a brief time period?
I mean, all of your data will be exposed and can be exploited by the other person without your knowledge. Well, in that case, the best thing you can do is password protect a folder that contains your essential data.
But when it comes to Windows 10, there’s no direct way to lock folder in Windows 10. You’ll have to make some effort to get that done, and I am going to tell you how.
Methods To Password Protect A Folder In Windows 10
There are two methods to lock a folder in Windows 10:
- Text-based Folder Lock (Creating Batch Scripts)
- ZIP lock Folder
Password Protect A Folder In Windows 10 Using A Batch (BAT) File
In case you’re wondering what a Batch file is, then you can read all about it in our detailed post.
Just follow these steps to password protect a folder in Windows 10 without any software.
Note: Before you follow the given steps to lock a folder, I recommend you to create a backup of your data to be on the safe side.
- Open the folder that you want to lock.
- Within the folder, right-click in the empty space and navigate to New>Text Document.
- In the black text document, copy and paste the following code:
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%==your_password 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
- In the code, find the if NOT %pass%==Your-Password goto FAIL line.
- Replace the Your-password bit in the line with your own password.
- Now, click on File and select the “Save As” option.
- In the Save as type dialog box, change the file type to All Files.
- Next, change the file name to anything, however, use the .bat extension at the end of the name.
- Now, you’ll see a newly created Batch file in the folder.
- Double-click on the newly created Batch file and a new folder will be created by the name Locker.
- Move all the files you want to protect in the ‘Locker’ folder.
- Â Launch the Batch file again and type y to password protect the folder.
- Then, press ENTER, and you’ll see that the folder will disappear.
Also Read: How To Reset Windows 10 With And Without Password
How To Get The Locked Folder Back?
- To get the Locker folder back, double-click on the Batch file.
- Next, type the password you’ve previously assigned to the folder and hit ENTER.
- That’s it; the folder will appear right back in front of you.
Password Protect A Folder In Windows 10 Using A Compression Software
We’ve already told you about many compression software. However, you may not know that some compression software allow you to lock and encrypt a folder in Windows 10, like 7-ZIP.
- First, download and install 7-ZIP on your system.
- Next, in the 7-ZIP app, locate and select the folder you want to lock and click on the + icon in the top left corner.
- Now, enter your desired password in the encryption section and click on OK.
A new encrypted and compressed file will be created with the same name as the original folder.
However, this process won’t delete the original “unlocked” folder by itself. So, you’ll have to do that by yourself.
Now, if you want to access the locked folder, just try extracting the ZIP file, and it will ask you for the password before extracting.
Also check out our article on how to run bat file as administrator on windows with this detailed step by step guide here!
How To Hide Files and Folders In Windows 10?
If the previous two methods are time-consuming for you, then you can always follow the traditional method to protect a folder in Windows 10, i.e., hiding a folder.
The process of hiding a folder in Windows 10 is something that almost every Windows user knows. However, if there’s a chance that you don’t know how to do that, then here are the steps:
- Right-click on the folder you want to hide and click on Properties.
- Besides Attributes, check the Hidden option and click on OK. The folder will now be completely hidden from you and the others.
However, you can see the hidden folders by clicking on the View tab of the Windows 10 file manager. Then, you have the check the box for Hidden items.
You can also unhide the folder by going back to the folder’s properties and unchecking the Hidden option.
I hope that at least one of the methods helped you to lock a folder in Windows 10. Even though hiding a folder is much easier than other methods discussed above, I would still recommend that you opt for the text-based or Zip Lock folder method. That is because even a child knows to access the hidden folders in Windows. Also you can read our article on what is kensington lock slot in laptop in details here!