Friday , June 21 2024

How to create a Password Protected Folder in Windows 7?

Data confidentiality is one of the main concerns in windows environment. Your data should be protected even your computer is accessed by unauthorized user. So the most confidential data is saved in password protected folders.

Make a folder locked making password protected also hidden, so that any third-party cannot access its contents. There is a lot of paid software, available in the market to hide or lock your folder in Windows. In this article, I’ve described the process to lock the folder by creating a simple Batch file.

How to create the batch file to lock a folder
1. Copy and paste the following codes in a notepad file.



title Folder Confidential

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

if NOT EXIST Confidential 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.



ren Confidential “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%== Replace this Red portion with your password goto FAIL

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

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

echo Folder Unlocked successfully

goto End


echo Invalid password

goto end


md confidential

echo Confidential created successfully

goto End


2. Save the file as “Key.bat”.
3.   When you’ll double-click on the Key.bat file for first time, a folder “Confidential” will be automatically created. You can move all your confidential data in that folder.

4.    Now to lock the folder just double-click on the file “Key”. You will get a confirmation message in Command Prompt. Type “y” to confirm. Now the folder “Confidential” will be locked and hidden.

 How to create a Password Protected Folder in Windows 7?

5.  If you want to get access to the contents of the folder then again double-click on the batch file, you have created. Immediately you will be prompted to enter your password. After that you can get access to the folder “Confidential”.

 How to create a Password Protected Folder in Windows 7?

By this process you can password protect the folder and no body can get access to the folder without the password. But still there is some risk. If some body is a computer savvy then he can easily retrieve the password from your batch file. He can easily find the password by choosing “Edit” option from the right-click context menu.

By IT Tutorials

About Ngo Thang IT

Check Also

How to Create a Remote Desktop Protocol (RDP) File

Cách dễ nhất để tạo một file .RDP là sử dụng Remote Desktop Connection có …

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Đăng Ký Nhận Tin Qua Email

Nhận thông tin bổ ích về WordPress, Hosting, Thủ thuật website, Download miễn phí....và các phần quà hấp dẫn qua email.

* là bắt buộc