Are you the one who share their Computer with members of family or colleagues at the office? If yes, then you may at some point of time, want to keep some of the personal files hidden from other users.

There are many free and paid folder and file locking applications available. You can select anyone of them to create folder lock and secure your private files. But you can also securely encrypt and hide your files and folder with a simple application like Notepad++. Follow the steps given below to use this simple security trick.

Create folder lock using Notepad, password protect folder without software

You only need to create a batch file using Notepad to password protect folder and impose an extra layer of protection on your confidential data. Nobody can access your protected folder without knowing the password. Once you put a password on the folder in Windows PC, you can keep the documents and other media files which you want to hide from others.

There is no need to find best folder lock software as you can encrypt a folder by creating a simple password protection program. Although there are many folder lock apps for Windows 10/8 PC, it’s considered to be a secure way to lock a folder without software as the third party software may infect your PC with malware.

The password protected Windows folder helps you to share your computer even with the persons who always try to steal your personal or professional data. The encrypting a folder means the sensitive information is secure on your Windows PC.

Recommended: How to Password Protect Files and Folders in Windows PC using Encryption

How to Create Folder Lock Using Notepad

Step 1: Download the .zip folder by clicking on the below-given download button and extract the .txt file from it.


Step 2: Open the .txt file using Notepad or Notepad++. Replace “Digitalriser” (in 23rd line) with your desired password.
Step 3: Now save this modified file with .bat extension. For instance, we have saved the file with name “secure.bat”.

.bat file created using notepadStep 4: Double click on the secure.bat file which creates a “Secure” folder on the same location where you saved secure.bat file.

secure folder created by double clicking on batch file

Step 5: Copy the files which you need to password protect into this “Secure” folder.
Step 6: Now double click on the secure.bat file again. The command prompt window will launch displaying message “Are you sure you want to lock the folder(Y/N)”. Type Y and then press Enter to lock your folder. The cmd prompt window will automatically be closed and nobody will be able to see your protected folder.

press Y on cmd prompt to lock folder

Step 7: Whenever you want to unlock protected folder, you need to open the .bat file, type your password and press Enter.

enter the password to unlock folder

If you find any problem while protecting your folder with password, let us know via comments. We shall assist you to resolve the issues.


  1. I have followed the procedure described in “How to Create Folder Lock Using Notepad”. I copied and pasted the content of the .bat file. The folder “Secure” is created but does not lock. Every time I double click the .bat file I get the same message asking if I want to lock the folder. I have tried responding with both upper case Y and lower case y and pressing the Enter key. The message window disappears and an ew file is created above the .bat file labelled o with two dots over it. I have deleted the Secure file and the .bat file and followed the whole creation procedure again from the beginning, but with the same result. The Secure file does not lock. I have checked that the .bat file code is complete, as below:
    title Folder Secure
    if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
    if NOT EXIST Secure goto MDLOCKER
    echo Are you sure you 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
    ren Secure “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
    attrib +h +s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
    echo Folder locked
    goto End
    echo Enter the Password to unlock folder
    set/p “pass=>”
    if NOT %pass%== Digitalriser here goto FAIL
    attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
    ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Secure
    echo Folder Unlocked successfully
    goto End
    echo Invalid password
    goto end
    md Secure
    echo Secure created successfully
    goto End


Please enter your comment!
Please enter your name here