Hi 在樷林里䒙起耒,
To protect your folder, go through the following steps:
- Before attempting so, create a dummy folder on which you can try password protection process.
- Then, create a new text document by doing a right click, go to a New option and select Text Document.
- Then, open the document and paste the following in it:
cls
@ECHO OFF
title Folder Private
if EXIST "HTG Locker" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
: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 Private "HTG Locker"
attrib +h +s "HTG Locker"
echo Folder locked
goto End
:UNLOCK
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%==
PASSWORD_GOES_HERE goto FAIL
attrib -h -s "HTG Locker"
ren "HTG Locker" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End
Here, you’ll see PASSWORD_GOES_HERE, change it with the password which you want to put for your folder.
- Now, save the file name as locker.bat and make it as All Files in an extension.
- Once the file is saved as a batch file, then you can delete the original text file.
- Now, do a double click on the batch file, and it will show create a private folder for you.
- Fill all your important files in the private folder and after that, do a run the locker.bat file.
- After this, a window will appear asking for Y/N in the case ‘Are you sure you want to lock the folder’.
- Press Y and hit Enter.
- After that, you’ll see that your folder get disappear.
If you want that folder back again, then simply click on the locker folder, it will prompt up a window for you asking for the password which you have set for a confidential or a private folder.
I hope it will work for you.
Cheers!!!