Locking a folder becomes necessary at times. In windows 7, there’s a definite process that works out. Here is how you do it


First create a folder. Check the diagram on how to do it.


Right click your mouse on your desktop. Move your curser on ‘NEW’, and then click on the folder.

lock folder in windows 7

You create a folder.
Open the folder by double clicking it. Once the folder is open, right click, move your curser to ‘NEW’. Scroll down your mouse on the right and move it on ‘text document’, and click it.

windows 7

You have a structure like this

how to lock folder in windows 7

Double click the “New Text Document” and you will find a new screen –

lock folder windows 7

You will have to paste the following code in the “New text document” –
title Folder Private
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
if NOT EXIST Private 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 Private “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}” Private
echo Folder Unlocked successfully
goto End
echo Invalid password
goto end
md Private
echo Private created successfully
goto End
In the section “password goes here”, replace it with your own password.
Once you replace the password, you will have to open the file and save it as locker.bat. In the file type, use ‘all files’.

how to lock a folder in windows 7
Once you save the file, the folder will have this look –

how to lock folders on windows 7

Open ‘locker.bat’ file and it will open. There is a file named ‘private’. Move any file you like to lock. Don’t copy, just move it by holding the curser, and bringing the file on to private.

lock a folder in windows 7

To lock the file, click ‘locker.bat’ file twice.

lock folder in windows 7
The screen will ask a question “Are you sure you want to lock the folder?”


Type – ‘Y’ and enter.


The folder is locked.

lock folder for windows 7
To open the ‘locker.bat’ file, you will have to double click it twice. The screen will pop a question asking a password.

lock folders windows 7

Enter the password, and the file will open up.


Also Read – How to treat Acne

Leave a Reply

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

Name *
Email *

Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Pinterest
Share On Youtube
Share On Stumbleupon
Contact us
Hide Buttons