Of course, we have files and folders on the computer we try to keep prying eyes off. Putting them in a random folder or renaming them is never a good idea. The Recent Document feature in Windows 10 will sell you out. Therefore, using a password to lock/protect your folders and files is much more reliable.

Then what you need to do is to clean every piece of private trace online. But you do not have to do it on your own. Online Protection solution, like Neptune SystemCare Ultimate, removes all the traces such as download and browsing history, cookies and caches, etc. and keeps your online privacy confidential.

OK, let’s get back to how to password protect a folder or file in Windows 10.

Step 1 | Open Notepad

You can simply right-click inside a folder, then choose New -> Text Document.

Step 2 | Copy and Paste the Code in the Document

Now just copy the text below and paste it into your document.


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 you want to lock this 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

Step 3 | Edit Folder Password

If you are careful enough, you will notice a tacky pink highlighted area (Your-Password-Here line of text) in the code. Here you should follow:

Use the cursor to cover Your-Password-Here, and then write down your own strong password.

Step 4 | Save Batch File

Now save the file as whatever name you like, but make sure the name ends in .bat and that you select All files in the drop-down box when saving.

Step 5 | Create Folder

Now double-click on the batch file you just created (or select and hit Enter). You'll notice a new folder come up. You can add to or remove files from it anytime.

Step 6 | Lock the Folder

Now, to lock the file, you can simply double-click on the batch file (or select and hit Enter).

Then type 'y' on the window that pops up and hit Enter. The window would disappear afterward.

Step 7 | Access Your Hidden & Locked Folder

Now whenever you need access to your secret folder and want to fill any other files or folders in, just double-click on the batch file, input your password and hit Enter.

Then you can follow the Step 6 to lock it up again.

It’s free and easy to password protect a folder or files in your Windows 10 computer.