How to protect folders with a password without using software

We all agree that one of the most important points to consider to safeguard the data integrity and security on a PC, is to keep safe from prying eyes everything that is related to our work or our social life.

One of the best ways to keep safe and hidden information in a PC is undoubtedly through a password protection. This method will allow us to maintain for safekeeping any information that we consider private, avoiding the possibility that anyone else can interfere in our private affairs.

Protect folders without software

Nowadays on the market there are many applications that can be used for this purpose, but if we are one of those users who like to have full control of everything that happens on your computer building our own software, this is the perfect opportunity to implement the latter skill, because then we will provide the necessary instructions to create a batch file that will allow us to lock a folder and prevent access to strangers.

How to achieve it?

Step 1. Firstly, open Notepad and paste the following text:



title Private Folder

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

if NOT EXIST Private goto MDLOCKER


echo Confirm before locking the folder (Y/N).

set/p “cho=>”

if %cho%==S goto LOCK

if %cho%==s goto LOCK

if %cho%==n goto END

if %cho%==N goto END

echo Select the correct option.



ren Private”Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”

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

echo Locked folder.

goto End


echo Enter the password to unlock the folder.

set/p “pass=>”

if NOT %pass%==


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

ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Confidential

echo Folder successfully blocked.

goto End


echo The key does not match! Enter the password again.

goto end


md Private

echo The Private folder is created successfully.

goto End


Step 2. Save the resulting file as pass.bat

Step 3. To run this file we must double-click on it. At this point a folder named “Private” will be created.

Protect folders without software

Step 4. Move the files and documents we want to remain locked and hidden to this new folder and double click on the file “pass.bat”.

Step 5. In this point it will open instance a Windows Command Prompt asking for confirmation of the action. Press the “Y” key.

Step 6. Once down the “Y” key, the program will start acting blocking and hiding the contents of the Private folder.

Protect folders without software

Note that if we want to access the contents of the folder to edit them, simply double click on the file “pass.bat” again, which again ask the password to enable edit content freely.

Protect folders without software

NOTE: It is very important to mention that this type of execution batch files are easy to edit by anyone with a certain level of computer skills, so it is advisable to convert your code to an executable file types such as exe.

If you liked this page, you can share…