This video will show you how to protect your folder with a password batch file in Windows 10. It includes the following:

  1. Folder Password Protection
  2. FolderLock.bat
  3. Batch Files

Password protected folder Windows 10

You can easily lock any folder on your Windows 10 PC with a simple batch file, created in Notepad. Using a batch file allows you to assign a password to a folder that you want to be locked – you can even hide the folder instead of just password protecting it, and make it reveal itself or its contents only by entering the master password. It’s a great trick for anyone who needs to safeguard important information or files that he/she doesn’t want to be accessed by other users. The trick also works on every version of Windows but not prior to Windows 95.

There are many other software applications out there that are capable of locking folders and files in a more convenient way, they protect your data with a password, and can also encrypt your data:

  1. FSPro utilizes a feature called My Lockbox – where you can store your private files in a folder that is protected with a password.
  2. There is also Hide Folders 5 – allows the user to hide, lock and password protect files.

That being said, some users prefer not to download extra third party software to lock their files and folders. Here is a step-by-step guide to how you can password protect your folder/folders without having to install anything else – by creating a batch file in the native Windows environment using Notepad:


How to password protect a folder in Windows 10

Open Notepad and enter the following script:

title Folder Locker
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 Locker "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=>"
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
echo Invalid password
goto end
md Locker
echo Locker created successfully
goto End


  1. After pasting the text into Notepad, change the password to your liking where it says “TYPE_YOUR_PASSWORD_HERE“.
  2. Save the Notepad document as a batch file with the .bat extension.
  3. Close the window and run the batch file. It will create a new folder called Locker.
  4. Put all the files you want to be locked into the password protected Locker folder.
  5. Open the batch file and it will ask you to lock the folder.
  6. Click Yes and your folder should now be password protected.