Step 1: Copy the following code in notepad.
cls
:End
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST FLocker goto MDFLOCKER
: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 FLocker "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%==P@ssw0rd@123 goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" FLocker
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDFLOCKER
md FLocker
echo Locker created successfully
goto End
In the above P@ssw0rd@123 is the password for the folder, you can change it on your choice.
Step 2: Save it as folderlock.bat on location of your choice.
Step 3: Open the folderlock.bat from the saved location, in that location you will find FLock folder.
Step 4: Copy your files into that folder which is to locked.
Step 5: Open the folderlocker.bat againg, Type Y for locking the folder.
Step 6: Once done, your FLocker folder will be invisble and protected. if you want to unlock the folder again, open batch file and type the password then press Enter.
That’s All.