If you work with computer files you only want yourself or specific people to be able to access, you may wonder how to put a password on a folder.
Doing so means only people with the password can see the contents. That could be helpful for boosting security in both your work and personal life. For example, if you’re working on the details of a surprise birthday party for a friend and have related folders, those would be good to password-protect.
Or, if you have confidential documents for work and worry about someone intentionally or accidentally seeing them, it’s useful to know how to apply a password to the folder that holds them. Your workplace may even require you to do that as part of its cybersecurity strategy.
One of the potential downsides of encrypting files in password-protected folders is that doing so could make it challenging to collaborate with others — especially if you have a large team. It also gives you something to remember to do, since you have to make sure to provide a person with the correct password when you decide they need to use the folder.
Although password protection is not the best option in every case, it’s good to know how to do it when necessary or desired. Let’s get started.
The Windows operating system does not make it as easy as you might expect to use a password for a folder. The closest native option is to encrypt the contents of a folder to safeguard them. Otherwise, you need to use a third-party program to set up a password-based system.
If you’re interested in the encryption option, here’s what to do:
After you do that, a window will pop up that contains the encryption key and an accompanying certificate. You’ll also get a prompt asking if you want to back up the encryption key and certificate in case you lose it. Follow the steps described in the window if you choose that option.
You may already know how to rename Windows folders in bulk. If you want to do something else in bulk by applying passwords to several folders, the encryption method above isn’t ideal. However, another available option is to use a batch script. First, create a new folder in Windows that you’ll use as a safe. Right-click anywhere on the screen and choose New > Folder.
Then, go inside your new folder by double-clicking it. Next, right-click inside the folder and choose New > Text Document.
Once you have the text document open on your screen, paste this text into it:
: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
Notice the “if NOT %pass%==your_password goto FAIL” line? Change the “your_password” part so it shows whatever password you want to use.
Finally, go to File > Save As and save the file. Make sure to add the .bat extension to the end. Double-click the BAT file to create a folder of the same name. Then, drag all the files you want to protect inside that folder and double-click your BAT file again. You’ll then see a command prompt that asks you if you’re sure you want to lock your folder. Press Y on your keyboard, then the Enter key.
The Mac operating system is similar to Windows in that you can’t apply a password directly to a folder, but can set up a password-protected disk image.
Putting passwords on folders like this is an excellent way to immediately enhance your cybersecurity strategies. Also, it only takes a minute or two after you get used to the steps.
Learning how to put a password on a folder is an excellent way to ensure only authorized parties see the contents. Think about doing it the next time there’s a chance or a certainty of someone using your computer or being able to access it.