How to Lock a Folder in Windows 7/8/8.1

Affiliate disclosure: In full transparency – some of the links on our website are affiliate links, if you use them to make a purchase we will earn a commission at no additional cost for you (none whatsoever!).

Being a Blogger I have a lot of stuff on my laptop that I don’t want to share with anyone else, rather I don’t even want that they should even see that stuff. So what I do is simply put up a lock on my folder and keep a secret key to open up the folder. Well don’t think that the trick is only for bloggers;-), the trick can be easily implemented by any person who wants to hide his private stuff.

You all might be thinking that it’s not possible to put up a password for a particular folder so how did I manage to do it?

Well in this post I will be sharing a really cool trick, which will enable you to set up a password for a particular folder easily, you won’t even have to use CMD for this trick. And if you want to protect any particular folder, you can see this explaining How to Protect a Folder in Mac?

So, without any further delay, let’s begin:

Follow These Steps to Lock a Folder:-

1. Firstly right-click, go to new and make a new Notepad.

2. Once you have made a new notepad, open it up and copy the below-given code in the notepad as it is.

cls
End
@ECHO OFF
title Folder Locker
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
CONFIRM
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.
goto CONFIRM
LOCK
ren Locker “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
attrib +h +s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
echo Folder locked
goto End
UNLOCK
echo Enter password to Unlock folder
set/p “pass=>”
if NOT %pass%==YourPassword goto FAIL
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
FAIL
echo Invalid password
goto end
MDLOCKER
md Locker
echo Locker created successfully
goto End
End

3. Now once you have copied this, as it is Replace this PASSWORD HERE with your desired password.

How-to-Lock-a-Folder-in-Windows-7

4. Once you have followed all the above save this Notepad, file>Save As> and save the notepad by the name “locker.bat”‘

5. Now  Double Click on the locker.bat file, and it will automatically open up a folder named PRIVATE.

6. This is the locked folder where you can store all your stuff easily.

7. Once you have copied all the stuff that you want to hide just simply click on the locker.bat file again and you will see that the folder will vanish from there and the next time you open it by clicking on the locker file, it will ask you for the password.

So these were the 7 simple steps that you need to follow, in order to set a password for your folder. Hole you enjoyed it.

Rishika Jindal

A zealot author, a story teller and a Philocalist who loves to write on various topics trending on social media. She's a work in progress and a budding visual artist and works with tools like Elementor to build awesome webpages. Check out this blog, MegaBlogging, for best guides on Elementor.

4 thoughts on “How to Lock a Folder in Windows 7/8/8.1”

  1. Nice trick for making folders private in Windows latest versions. Everyone have stuff to hide from public(e.g. Work files, adult videos, etc), So these tips are awesome for wide use. No software installed & other stuff… Just create your own Locker in Windows. Good one.

    Reply
  2. I follows all the 7 steps in the process and made a locker.bat file. Now when I try to open that files nothing happens except error in Command Line.
    I use Windows 8.1 Pro. Is this trick doesn’t work with Windows 8 PC?

    Reply

Leave a Comment