How to Password Protect a Folder in Windows 10 Using Batch Code

How to Password Protect a Folder in Windows 10

In This Tutorial, You’re going to Learn How to Password Protect a Folder in Windows 10 Using Batch Code with the help of Batch Programming.

You don’t need to learn to code, it’s a super simple tutorial for you. You just need to use the code to create a password-protected folder in Windows 10.

Firstly, you need to copy the code provided in step 1. Then paste the code in notepad and save it.

After saving, you will get a file with extension .txt because you’ve created a text file, right. But you need to change the file extension in order to run the code.

Let’s see more steps in detail in our provided steps on How to Password Protect a Folder in Windows 10 Using Batch Code.

How to Password Protect a Folder in Windows 10 Using Batch Code

Step 1: Copy This 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% == Techerge.com GOTO FAIL
attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303­­­09D}”
ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303­­­09D}” Locker
echo Folder Unlocked Successfully.
GOTO END
:FAIL
echo Invalid Password!
GOTO END
:MDLOCKER
md Locker
echo Folder created.
GOTO END
:END

This is a Batch Programming code that can be accessed on Windows Platform, copy this entire code.

Step 2: Open Notepad

Notepad

Type in Search, Notepad then you will see Notepad icon in the list of the programs, click on it to open the notepad.

Step 3: Paste the code and save as Text File

How to Password Protect a Folder in Windows 10

Paste the entire code into the notepad and save the file in .txt text format.

Step 4: Right Click on File >>Rename

How to Password Protect a Folder in Windows 10

This step is a part of the next step. Right-click on the Text File and click on Rename.

Step 5: Change File Extension From .txt to .bat 

How to Password Protect a Folder in Windows 10

This is an important step, .bat extension is needed to run a batch programming code on a windows system. The code will work on windows after changing the file extension.

Step 6: Double Click on the File >>Enter Password

batch code

Double click on the Password-Protected.bat File then a command prompt window will open, Enter the Password and hit Enter key.

Note: The Default Folder Password is Techerge.com (You can Easily Change the default Password, Right Click on File >>Edit >> Replace Default password with your own password).

Step 7: Locker Named Folder is Visible Now >>Put your Private Data into it

How to Password Protect a Folder in Windows 10

After Entering the Password, Locker named Folder will Visible.

Step 8: Hide “Locker” Folder

How to Password Protect a Folder in Windows 10

After Using Locker named Folder, double-click on the File again then you will see a new command prompt window. Type Y and hit Enter key.

That’ it. Now you can Hide your Private Data without the help of any third-party software.

Leave a Reply

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