Step 1: create a new folder
Step 2: create a new text document
Step 3: copy the below code into it(NOTE: make sure type = “all
files” while saving)
Replace “PASSWORD_GOES_HERE” in the below code with any password that you want.
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
Step 4: save it
with “locker.bat ” name.
Step 5: double
click on locker file. Now you can see a folder “private”
Step 6: open
private folder “here you can save any confidential data”
Step 7: now
again double click on “locker”
you will be getting a promt msg that
“are you sure you want to lock the folder?”
type “y”-for yes, “n”- for no
Step 8: now this
private folder becomes invisible.
Step 9: If you want to open this folder again click on the
locker. It will prompt for password.
Step 10: now can see the private folder.
No comments:
Post a Comment