Looking for the Best Computer Services in New Jersey? Call: (908)-356-6171

Quick Tips

How to password protect folders in Windows 10

A useful way to help protect your business data is to limit access to it. There are many ways to achieve this with some being more complicated, or expensive than others. A quick and easy way that works well is to simply password protect some of your folders.

Used alongside disk encryption and other protections, this extra layer of defense can provide useful in protecting proprietary or customer data within your workplace. It won’t prevent hacking or data loss on its own but it can form part of defense in depth.

Password protect folders in Windows 10

With Windows 10 being a very popular operating system for home users and small businesses,. It makes sense to use that in our example. You can lock Mac folders too and we will cover that another time.

Back up your data before you lock down the folder.


  1. Right click an empty space within the folder you want to lock.
  2. Select New and Text Document.
  3. Name the document anything you like.
  4. Open the file and paste the following into it.


title Folder Locked

if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK



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.



ren Locked "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"

attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"

echo Folder locked

goto End


echo Enter password to Unlock folder

set/p "pass=>"

if NOT %pass%==PASSWORD goto FAIL

attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"

ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locked

echo Folder Unlocked successfully

goto End


echo Invalid password

goto end


md Locked

echo Locked created successfully

goto End

  1. Where you see ‘PASSWORD’ change that to a password of your choosing. Make it a strong one to adequately protect your data.
  2. Save the document by selecting Save as Type and selecting All Files. Call the file ‘FolderLockdown.bat’ and Save.
  3. Double click the file and you should see a new folder called Locked.
  4. Move the files you want to protect into the Locked folder.
  5. Double click bat again and select Y when it asks if you want to lock it.
  6. Hit Enter and the folder will be locked.

To unlock, double click FolderLockdown.bat and enter the password you entered when prompted.

Locking down a folder like this will not replace other security measures but is a useful way to help protect your data alongside such measures. If you need help with data security, New Jersey Computer Help will be happy to assist.

Leave a Reply

Your email address will not be published. Required fields are marked *