Skip to content

How to Protect Folder with Password without a Software

Reading Time: 5 minutes

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. Using this neat method you can protect the folder by password with a quick batch script. Below you can find the step-by-step instructions to protect the folder with a password.

Batch Script

A batch file is a sort of content document in DOS, OS/2 and Microsoft Windows. It comprises a progression of directions to be executed by the order line mediator, put away in a plain content record. A batch file may contain any order the mediator acknowledges intuitively and use builds that empower restrictive expanding and circling inside the bunch document, for example, IF, FOR, and GOTO marks.

The expression “batch ” is from clump preparing, signifying “non-intelligent execution”, however, a batch file may not process a cluster of various information.

Like Job Control Language (JCL), DCL and different frameworks on centralized servers and minicomputer frameworks, batch files were added to facilitate the work required for certain ordinary assignments by enabling the client to set up content to computerize them.

At the point when a clump record is run, the shell program (generally COMMAND.COM or cmd.exe) peruses the document and executes its directions, regularly line-by-line. Unix-like working frameworks, for example, Linux, have a comparable, however increasingly adaptable, sort of document called a shell script.

See also  10 Best Ways To Increase Your Youtube Channel Traffic 🟢

The filename expansion .bat is utilized in DOS and Windows. Windows NT and OS/2 additionally included .cmd. batch file for different conditions may have diverse augmentations, e.g., .btm in 4DOS, 4OS2 and 4NT related shells.

Filename Extension

.bat

The main filename augmentation utilized by Microsoft for cluster documents. This expansion keeps running with DOS and all renditions of Windows, under COMMAND.COM or cmd.exe, regardless of the diverse ways the two order mediators execute clump records.

.cmd

Utilized for batch file in Windows NT family and sent to cmd.exe for elucidation. COMMAND.COM does not perceive this document name augmentation, so cmd.exe contents are not executed in the wrong Windows condition unintentionally.

Furthermore, affix, dpath, ftype, set, way, assoc and provoke directions, when executed from a .bat record, change the estimation of the errorlevel variable just upon a blunder, though from inside a .cmd document, they would influence errorlevel notwithstanding while returning without an error. It is additionally utilized by IBM’s OS/2 for batch file.

.btm

The expansion was utilized by 4DOS, 4OS2, 4NT and Take Command. These contents are quicker, particularly with longer ones, as the content is stacked and prepared for execution, as opposed to line-by-line.

It’s important to note that this will not conceal your data from somebody who knows what they are doing.

Create A New Document

You can create a new document by Right-Click on Desktop or within a folder

notepad
4.Create A New Text Document

Create a new text document

newtextfile

Tap Enter. Now the text document is created

file create

To protect the folder with a password

Copy the below code into Notepad 

See also  Pen drive displaying only shortcuts - Solved

cls
@ECHO OFF
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
if NOT EXIST MyFolder goto MDMyFolder
:CONFIRM
echo Are you sure to lock this 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 MyFolder “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 Your Secure Folder
set/p “pass=>”
if NOT %pass%== your password goto FAIL
attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” MyFolder
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDMyFolder
md MyFolder
echo MyFolder created successfully
goto End
:End

Find “Your password” in the above code

how to add password to a folder

Replace “Your password” with password of your choice

Replace password

Now Goto->File

protect file

Select Save AS

filesave

Select File type

You can select it in save as type window

file type

Select All files from drop down menu

allfile

Rename file as Locker.bat (.bat ext must)

folder protect

Now its Saved!

file protect

Double click Locker.bat file to generate “MyFolder”

protectfile

Copy your secret file into “Myfolder”

protect files

Now click Locker.bat to lock “MyFolder”

lockfolder

Type “Y”to lock

folderprotect

Click Enter, Now the “MyFolder” window will disappear along with your secret files.

filepassword

To unlock the folder, Double click Locker.bat file

fileopen

Now enter the password you have mentioned in Step 6

password

I have mentioned SWOT as my password. Press Enter

filepassword

Now, the locked folders are back

unlockfolder

Now you can find your hidden files!

Extras:

To protect folder with password again repeat steps 15,16 and 17

Pros

  • Protecting a folder with a password is simple to go.
  • The main thing you have to do is to spare the content and make the task.
  • It doesn’t bother with any confusing activity or expert information.
See also  How to create a windows folder without name

Cons

  • Not sheltered and is anything but difficult to be split.
  • Does not support bolting a cluster of folders at any given moment.

Leave a Reply