Hackernoon logoHow to Protect Folders And Files in Windows using Passwords by@jan-youngren

How to Protect Folders And Files in Windows using Passwords

Author profile picture

@jan-youngrenJan Youngren

Cybersecurity Expert | Focused on research and investigations

Sometimes, we need to apply a bit of extra protection to the data on our computers. We might want to protect our tax records from prying eyes, or lock away business plans from our competitors. Or we might just want to ensure that any children with access to our device can't access inappropriate content.
In any case, knowing how to add password protection to a Windows folder is a useful skill. But as any Windows 10 users will discover when locking down folders, it isn't as easy to do so as you might think.
Windows 10 does not allow folders to be password protected as a native feature (unlike earlier Windows versions). Nevertheless, it can be done, and you don't need to download third party software.
Just follow this tutorial, and you'll be able to add password protection to any sensitive files in minutes.

How to Apply Password Protection to a Folder in Windows 10

First, open Windows Explorer and then open the folder that you'd like to password protect.
Right click on an empty patch of space inside the folder, bringing up the file menu.
Choose "New" from the file menu and then choose "Text Document."
A new text file should be created inside the folder. There's no need to give it a specific name right now.
Open the text file you have created. Notepad will do just fine for this.
Now comes the technical part, although it's very simple if you just follow the instructions. Copy and paste the code below into the text file:
@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-Here 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 text, use the find function to locate a command including the text "your-password-here"
Enter a strong password here. This will become the password to access your folder, so make it hard to guess.
Now, save the file and choose the "All Files" type. Name the file "FolderLocker.bat" and press Save.
Run FolderLocker.bat, then check your original folder. You should see a new folder called "Locker." This will act like a conventional folder, just with password protection applied. However, it's not "locked" yet.
Before locking the folder, add any items that need to be password protected by dragging as normal.
When you're done, run FolderLocker.bat in the original folder.
You should now see a prompt asking whether you want to lock the folder. Type "Y" and the folder will seemingly disappear.
The folder hasn't been removed. Instead, it has been hidden and a password has been applied. To open it, run "FolderLocker.bat" and enter your password when prompted.

Going Deeper with Windows Password Protection

The process above will add password protection to simple folders. However, we can also password protect individual files. That can be a more efficient and targeted option for sharing confidential pdfs or images, and it requires a slightly different procedure.
Adobe Acrobat can be used to protect pdf files. Just open the document to be protected, go to the "File" menu and choose "Protect Using Password". You can then set a password for either viewing or editing the document.
If you need to password protect a Windows doc file, open Office and bring up the document. Head to "File", "Info", and then "Protect Document". Then choose the "Encrypt with password" option.
The two processes above can also be used to protect other file formats such as jpeg images. Just import them as usual, and apply the procedures described.

If All Else Fails, Choose Third Party Software

Finally, we need to mention third party tools. If the procedures described earlier don't work for some reason or are excessively complex, third party software can provide an alternative.
Reliable apps include WiseFolder Hider - a freeware tool which hides files and folders, and can add passwords easily. Commercial tools like FolderGuard, Folder Lock Lite, and Protected Folder all provide the same service, as well as a few other system security features. So have a look around and investigate the options.

Tags

The Noonification banner

Subscribe to get your daily round-up of top tech stories!