How to Create a Password Protected Folder

There are a lot of methods that you can use to create a password protected folder, most of which require the use of some third party software. This method will show you to hide your folders with a quick batch script.

1. Copy the code from here and create a new text document.

Step 1

2. Paste the code into that text document and find the “Your Password” and change it on how do you want the folder password to be.

Step 2

3. When you’re done click on File>Save As and save it on desktop with your desired name but with .bat extension.

Step 3

4. Now go to your desktop and open the file that you just created and follow the on screen instructions.

Step 4

5. Now a folder will appear on your desktop , just drag the files-folders that you want to lock on that folder and than close it.

Step 5

6. When you’re done dragging the files you want to lock open up the .bat file that you created earlier and press to lock that folder.

Step 6

7. Now the folder from desktop will disappear becuase is locked , to unlock it open up again the .bat file on your desktop and type in your password and the folder will be unlocked.

Step 7

 Script Code:

cls
@echo off
title Folder Locker
IF EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303­09D}” GOTO UNLOCK
IF NOT EXIST Locker GOTO MDLOCKER
echo Folder Created.
:CONFIRM
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
:LOCK
ren Locker “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303­09D}”
attrib +h +s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303­09D}”
echo Folder Locked.
GOTO END

:UNLOCK
echo Enter password to unlock the Folder :
set/p “pass=”
IF NOT %pass% == YourPassword GOTO FAIL
attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303­09D}”
ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303­09D}” LOCK
echo Folder Unlocked Successfully.
GOTO END
:FAIL
echo Invalid Password!
GOTO END

:MDLOCKER
md Locker
echo Folder created.

GOTO END
:END
PAUSE

Miguel

I started this tech blog back in 2011 as a place to write down processes I took to fix my client systems and network. Now I write some tips and tricks to help others with the tech issues that one might encounter.

You may also like...