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.
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
4.Create A New Text DocumentCreate a new text document
Tap Enter. Now the text document is created
To protect the folder with a password
Copy the below code into Notepad
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
Replace “Your password” with password of your choice
Now Goto->File
Select Save AS
Select File type
You can select it in save as type window
Select All files from drop down menu
Rename file as Locker.bat (.bat ext must)
Now its Saved!
Double click Locker.bat file to generate “MyFolder”
Copy your secret file into “Myfolder”
Now click Locker.bat to lock “MyFolder”
Type “Y”to lock
Click Enter, Now the “MyFolder” window will disappear along with your secret files.
To unlock the folder, Double click Locker.bat file
Now enter the password you have mentioned in Step 6
I have mentioned SWOT as my password. Press Enter
Now, the locked folders are back
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.
Cons
- Not sheltered and is anything but difficult to be split.
- Does not support bolting a cluster of folders at any given moment.