Lock Folders Using Notepad

lockerHello.

Have you ever wondered if it is possible to Lock Folder using Notepad?

Well yes it is possible to Lock Folder Without Any Software. This method works fine in Xp/Vista and hopefully upper versions of windows.

Please don’t use this method if you are unsure what you are doing, I am not responsible for any damage caused by use of this, though it won’t occur if you follow my steps correctly.

Here we start:
Open Notepad from your Start -> All Programs -> Accessories -> Notepad
notepad

01. Copy and Paste the below code in Notepad and Save it as FolderLock.bat

cls
@ECHO OFF
title Folder Locker
if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
: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 Locker “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%==type your password here goto FAIL
attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”
ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” Locker
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Locker
echo Locker created successfully
goto End
:End

folder locker
bat file

02. Now Double Click that new Batch file named FolderLock and it will make a new folder named Locker in the same location:
bat file
bat file

Now put the Data Inside the folder Locker and again Double Click the Batch file to Lock it, this will give you a prompt, just Type y and press Enter:
bat file

To Unlock the Folder just double click the Batch file again and type y and press Enter.

Now keep the Batch File named FolderLock.bat in a different place like your USB Pen Drive so that only you can access the Folder you have locked.

Hope this helps. If you have any question or doubt, please leave a comment and I will get to you as soon as possible and will help you to best possible way.senyum

Comments

  1. WELCOME TO HACK AND CRACK AND DOWNLOADS says:

    cool…tutirial..lemme try this

  2. Bariski says:

    Hope you enjoy thus simple but effective tutorial :)

  3. Web hosting reviews says:

    Hi, I just now created a folder lock using your coding, at present it is working fine but if in the future same file is corrupted than how can I access the it. Is there any recovery system.Thanks for sharing.

  4. Bariski says:

    See mate, just by keeping the files in that folder will never make them corrupt until you have been attacked by viruses or hard drive corruption (bad sectors). Well in that case you can recover data by using data recovery sofwares.

    Better use a good antivirus with combination of spyware to avoid them harming your system.

    Hope this helps.

  5. Blogger Styles says:

    Very interesting technique, I never thought Notepad can do this great task, you rocks!

  6. Bariski says:

    You are welcome mate. Thanks for the appreciation!

  7. Free T Shirts says:

    Very interesting solution to locking files. I believe Windows has a built protection feature that encrypts folders for the current user also.

  8. Bariski says:

    Yes but encryption is something else, I will discuss that solution too in coming times. :)

  9. linkuri says:

    Ok, cool method, but i want to change the password from y to something else. How can i do that?

  10. Anonymous says:

    Hey I dont know if you or others tried this, renaming the folder removes the protection. Thats too simple to get into the folder.

  11. Bariski says:

    @linkuri sorry to say but this was all taught in my class lol But will try it out when I will get free with some of my major project work :)

    @Anonymous, dude can you tell me how to rename a folder when it locked? :-/

  12. linkuri says:

    this script add the code {21EC2020-3AEA-1069-A2DD-08002B30309D} at the end of the folder name. U can rename the folder using a software like “unlocker” (http://ccollomb.free.fr/unlocker/) ;))

  13. Bariski says:

    Well it is not visible to everyone around, especially when it is hidden. So there is no point that others can unlock it. Moreover I have stated this method here so that you can hide files from your friends or family member lol like a important file or files. :|

  14. Anonymous says:

    @linkuri pass is at this line:

    “if NOT %pass%==type your password here goto FAIL”

    So u need to change “type your password here” with your password like:

    “if NOT %pass%==lamepass goto FAIL”

    So now every time you want to change the pass open the FolderLock.bat file in any text editor ‘n’ just change this line or rather the sting after “if NOT %pass%==”

  15. linkuri says:

    Thank you Anonymous, now it’s perfect :)
    Bariski, thank you to, but i have to asume that friends or family members are inteligent people :)
    I just saw that the folder it’s invisibile not hidden
    so they can not rename it

  16. Anonymous says:

    amazing…
    :-t

  17. Anonymous says:

    After locked, view hidden file can see and folder and double click it can open the folder. So what is the used?

  18. Anonymous says:

    how do i unlock the file after i forgot my paswword, grrrrrr…

  19. Hosting-ASAP "Web Hosting" says:

    Outstanding tutorial *clap*

  20. Panca says:

    So kind of you, nice trik…
    visit me http://pancallok.blogspot.com

  21. Itomo says:

    Cool, great tip friend !! I'm searching for a software that can lock my folders and you gave me a great tip. Thanks!!

  22. saurabh says:

    It is not working with WINDOWS 7.
    Can you please confirm ?

  23. anepFIDODIDO says:

    how can i access ‘locker’ folder when the folderlock.bat is missing?..help me

  24. Faid says:

    Try This . . .

    @ECHO OFF
    COLOR 1F
    MODE 47,6
    TITLE Folder Locker
    SET A=%MyFiles%
    SET B=Control_Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}
    SET C=FF41D262-C2A7-5795-89E4-00805F1408F3
    SET D=FDNME.BIN
    SET E=FDPWD.BIN
    FOR /F “TOKENS=*” %%A IN (%A%%B%%D%) DO SET %%A
    SET FOLDER=%NME%
    IF EXIST “%A%%B%%C%” GOTO CONFIRM0
    IF NOT EXIST “%A%%B%%C%” GOTO CONFIRM2
    :CONFIRM0
    IF EXIST “%A%%B%%E%” GOTO CONFIRM1
    IF NOT EXIST “%A%%B%%E%” GOTO NEWPASSWORD
    :CONFIRM1
    IF EXIST “%A%%B%%C%” GOTO UNLOCKCONFIRM
    IF NOT EXIST “%A%%B%%C%” GOTO LOCKCONFIRM
    :CONFIRM2
    IF EXIST “%FOLDER%” GOTO CONFIRM0
    IF NOT EXIST “%FOLDER%” GOTO CREATE
    :CREATE
    TITLE Folder Locker – [CREATE FOLDER]
    CLS
    ECHO Are you sure want to make new folder [Y/N]?
    ECHO.
    SET /P “CHOICE=¯ ”
    IF NOT DEFINED CHOICE GOTO CREATE
    IF /I %CHOICE% EQU Y GOTO CREATEFOLDERNAME
    IF /I %CHOICE% EQU N GOTO EXIT
    ECHO.
    ECHO Invalid Choice!!!
    PAUSE>NUL
    CLS
    GOTO CREATE
    :CREATEFOLDERNAME
    CLS
    ECHO Type name for your new folder.
    ECHO.
    SET /P “FOLDERNAME=¯ ”
    IF NOT DEFINED FOLDERNAME GOTO EMPTY4
    GOTO CREATING
    :CREATING
    CLS
    ECHO Please Wait . . .
    IF NOT EXIST “%A%%B%” MD “%A%%B%” >NUL
    IF EXIST “%A%%B%” ATTRIB +H +S +A “%A%%B%” >NUL
    IF NOT EXIST “%FOLDERNAME%” MD “%FOLDERNAME%” >NUL
    IF NOT EXIST “%FOLDERNAME%” GOTO UNABLECREATE
    IF EXIST “%A%%B%%D%” ATTRIB -H -S -A “%A%%B%%D%” >NUL
    IF EXIST “%A%%B%%D%” ECHO Y|DEL “%A%%B%%D%” >NUL
    IF EXIST “%FOLDERNAME%” ECHO.NME=%FOLDERNAME%>”%A%%B%%D%”
    IF EXIST “%A%%B%%D%” ATTRIB +H +S +A “%A%%B%%D%” >NUL
    CLS
    ECHO Folder created successfully . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :UNABLECREATE
    CLS
    ECHO Unable to create folder . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :EMPTY1
    ECHO.
    ECHO Empty Password!!!
    PAUSE>NUL
    GOTO CHANGEPASSWORD2
    :EMPTY2
    ECHO.
    ECHO Empty Password!!!
    PAUSE>NUL
    GOTO NEWPASSWORD
    :EMPTY3
    ECHO.
    ECHO Empty Name!!!
    PAUSE>NUL
    GOTO RENAME
    :EMPTY4
    ECHO.
    ECHO Empty Name!!!
    PAUSE>NUL
    GOTO CREATEFOLDERNAME
    :EMPTY5
    ECHO.
    ECHO Empty Name!!!
    PAUSE>NUL
    GOTO CREATENAME
    :LOCKCONFIRM
    TITLE Folder Locker – [LOCK FOLDER]
    CLS
    ECHO Type “RENAME” for rename your current folder.
    ECHO Type “CHANGE” for change your password.
    ECHO Are you sure want to lock your folder [Y/N]?
    ECHO.
    SET /P “CHOICE=¯ ”
    IF NOT DEFINED CHOICE GOTO LOCKCONFIRM
    IF /I %CHOICE% EQU Y GOTO LOCKING
    IF /I %CHOICE% EQU N EXIT
    IF /I %CHOICE% EQU CHANGE GOTO CHANGEPASSWORD1
    IF /I %CHOICE% EQU RENAME GOTO RENAME
    SET /P CHOICE=Invalid Choice!!!
    CLS
    GOTO LOCKCONFIRM
    :LOCKING
    CLS
    ECHO Please Wait . . .
    IF EXIST “%A%%B%%C%” ATTRIB -H -S -A “%A%%B%%C%” >NUL
    IF EXIST “%A%%B%%C%*” ATTRIB -H -S -A “%A%%B%%C%*” >NUL
    IF EXIST “%A%%B%%C%*” ECHO Y|DEL “%A%%B%%C%*” >NUL
    IF EXIST “%A%%B%%C%” RD “%A%%B%%C%” >NUL
    IF EXIST “%FOLDER%” MOVE “%FOLDER%” “%A%%B%” >NUL
    IF EXIST “%A%%B%%FOLDER%” REN “%A%%B%%FOLDER%” “%C%” >NUL
    IF EXIST “%A%%B%%C%” ATTRIB +H +S +A “%A%%B%%C%” >NUL
    CLS
    ECHO Folder locked successfully . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :RENAME
    TITLE Folder Locker – [RENAME FOLDER]
    CLS
    ECHO Type new name for your current folder.
    ECHO.
    SET /P “NEWNAME=¯ ”
    IF NOT DEFINED NEWNAME GOTO EMPTY3
    IF EXIST “%FOLDER%” REN “%FOLDER%” “%NEWNAME%”
    IF NOT EXIST “%NEWNAME%” GOTO UNABLERENAME
    IF EXIST “%A%%B%%D%” ATTRIB -H -S -A “%A%%B%%D%” >NUL
    IF EXIST “%A%%B%%D%” ECHO Y|DEL “%A%%B%%D%” >NUL
    IF NOT EXIST “%A%%B%%D%” ECHO.NME=%NEWNAME%>”%A%%B%%D%”
    IF EXIST “%A%%B%%D%” ATTRIB +H +S +A “%A%%B%%D%” >NUL
    CLS
    ECHO Folder renamed successfully . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :UNABLERENAME
    CLS
    ECHO Unable to rename folder . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :CREATENAME
    TITLE Folder Locker – [CREATE NAME]
    CLS
    ECHO Folder name is not set, type new folder name.
    ECHO.
    SET /P “NEWNAME=¯ ”
    IF NOT DEFINED NEWNAME GOTO EMPTY5
    IF NOT EXIST “%NEWNAME%” MD “%NEWNAME%” >NUL
    IF NOT EXIST “%NEWNAME%” GOTO UNABLECREATENAME
    IF EXIST “%NEWNAME%” RD “%NEWNAME%” >NUL
    IF EXIST “%A%%B%%D%” ATTRIB -H -S -A “%A%%B%%D%” >NUL
    IF EXIST “%A%%B%%D%” ECHO Y|DEL “%A%%B%%D%” >NUL
    IF NOT EXIST “%A%%B%%D%” ECHO.NME=%NEWNAME%>”%A%%B%%D%”
    IF EXIST “%A%%B%%D%” ATTRIB +H +S +A “%A%%B%%D%” >NUL
    CLS
    GOTO UNLOCKING
    :UNABLECREATENAME
    CLS
    ECHO Unable to create folder name . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :CHANGEPASSWORD1
    TITLE Folder Locker – [CHANGE PASSWORD]
    FOR /F “TOKENS=*” %%A IN (%A%%B%%E%) DO SET %%A
    SET PASS=%PWD%
    CLS
    SET PASSWORD=
    SET /P “PASSWORD=Enter Old Password : ”
    IF NOT DEFINED PASSWORD GOTO CHANGEPASSWORD1
    IF %PASSWORD%==%PASS% GOTO CHANGEPASSWORD2
    ECHO.
    ECHO Invalid Password!!!
    PAUSE>NUL
    GOTO CHANGEPASSWORD1
    :CHANGEPASSWORD2
    CLS
    ECHO Enter Old Password : OK
    ECHO.
    SET NEW=
    SET /P “NEW=Enter New Password : ”
    IF NOT DEFINED NEW GOTO EMPTY1
    IF EXIST “%A%%B%%E%” ATTRIB -H -S -A “%A%%B%%E%” >NUL
    IF EXIST “%A%%B%%E%” ECHO Y|DEL “%A%%B%%E%” >NUL
    IF NOT EXIST “%A%%B%%E%” ECHO.PWD=%NEW%>”%A%%B%%E%”
    IF EXIST “%A%%B%%E%” ATTRIB +H +S +A “%A%%B%%E%” >NUL
    CLS
    ECHO Password has been changed . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :NEWPASSWORD
    TITLE Folder Locker – [NEW PASSWORD]
    CLS
    SET NEW=
    ECHO Password is not set, type new password.
    ECHO.
    SET /P “NEW=New Password : ”
    IF NOT DEFINED NEW GOTO EMPTY2
    IF EXIST “%A%%B%%E%” ATTRIB -H -S -A “%A%%B%%E%” >NUL
    IF EXIST “%A%%B%%E%” ECHO Y|DEL “%A%%B%%E%” >NUL
    IF NOT EXIST “%A%%B%%E%” ECHO.PWD=%NEW%>”%A%%B%%E%”
    IF EXIST “%A%%B%%E%” ATTRIB +H +S +A “%A%%B%%E%” >NUL
    CLS
    ECHO New password has been set . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :UNLOCKCONFIRM
    TITLE Folder Locker – [UNLOCK FOLDER]
    CLS
    ECHO Are you sure want to unlock your folder [Y/N]?
    ECHO.
    SET /P “CHOICE=¯ ”
    IF NOT DEFINED CHOICE GOTO UNLOCKCONFIRM
    IF /I %CHOICE% EQU Y GOTO UNLOCK
    IF /I %CHOICE% EQU N EXIT
    ECHO.
    ECHO Invalid Choice!!!
    PAUSE>NUL
    CLS
    GOTO UNLOCKCONFIRM
    :UNLOCK
    FOR /F “TOKENS=*” %%A IN (%A%%B%%E%) DO SET %%A
    SET PASS=%PWD%
    CLS
    ECHO Type “CHANGE” for change your password.
    ECHO.
    SET PASSWORD=
    SET /P “PASSWORD=Enter Password : ”
    IF NOT DEFINED PASSWORD GOTO UNLOCK
    IF %PASSWORD%==%PASS% GOTO UNLOCKING
    IF /I %PASSWORD% EQU CHANGE GOTO CHANGEPASSWORD1
    ECHO.
    ECHO Invalid Password!!!
    PAUSE>NUL
    CLS
    GOTO UNLOCK
    :UNLOCKING
    CLS
    ECHO Please Wait . . .
    IF NOT EXIST “%A%%B%%D%” GOTO CREATENAME
    FOR /F “TOKENS=*” %%A IN (%A%%B%%D%) DO SET %%A
    SET FOLDER=%NME%
    IF EXIST “%FOLDER%” GOTO UNABLEUNLOCK
    IF EXIST “%A%%B%%C%” ATTRIB -H -S -A “%A%%B%%C%” >NUL
    IF EXIST “%A%%B%%C%” REN “%A%%B%%C%” “%FOLDER%” >NUL
    IF EXIST “%A%%B%%FOLDER%” MOVE “%A%%B%%FOLDER%” “.” >NUL
    CLS
    ECHO Folder unlocked successfully . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :UNABLEUNLOCK
    CLS
    ECHO Unable to unlock folder . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT

    1. mnms1983 says:

      does it work in xp ?
      i tried but not worked..

  25. Faid says:

    If you forgot your password, use this . . .

    @ECHO OFF
    MODE 45,8
    COLOR 1F
    TITLE Folder Locker – [PASSWORD RECOVERY]
    SET A=%MyFiles%
    SET B=Control_Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}
    SET C=FDPWD.BIN
    GOTO CONFIRM
    :CHANGEPASSWORD
    CLS
    SET NEW=
    SET /P “NEW=Enter New Password : ”
    IF NOT DEFINED NEW GOTO EMPTY
    IF EXIST “%A%%B%%C%” ATTRIB -H -S -A “%A%%B%%C%” >NUL
    IF EXIST “%A%%B%%C%” ECHO Y|DEL “%A%%B%%C%” >NUL
    IF NOT EXIST “%A%%B%%C%” ECHO.PWD=%NEW%>”%A%%B%%C%”
    IF EXIST “%A%%B%%C%” ATTRIB +H +S +A “%A%%B%%C%” >NUL
    CLS
    ECHO Password changed successfully . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :CHECK
    CLS
    IF EXIST “%A%%B%%C%” GOTO SUCCESS
    IF NOT EXIST “%A%%B%%C%” GOTO NOTFOUND
    :CONFIRM
    CLS
    ECHO Are you sure want to recover password [Y/N]?
    ECHO.
    SET /P “CHOICE=¯ ”
    IF NOT DEFINED CHOICE GOTO CONFIRM
    IF /I %CHOICE% EQU Y GOTO CHECK
    IF /I %CHOICE% EQU N EXIT
    ECHO.
    ECHO Invalid Input!!!
    PAUSE>NUL
    CLS
    GOTO CONFIRM
    :CONTINUE
    CLS
    SET CHOICE=
    ECHO 1. Change Password
    ECHO 2. Delete Password
    ECHO 3. Exit
    ECHO.
    SET /P “CHOICE=Your Choice : ”
    IF NOT DEFINED CHOICE GOTO CONTINUE
    IF /I %CHOICE% EQU 1 GOTO CHANGEPASSWORD
    IF /I %CHOICE% EQU 2 GOTO DELETEPASSWORD
    IF /I %CHOICE% EQU 3 EXIT
    ECHO.
    ECHO Invalid Choice!!!
    PAUSE>NUL
    CLS
    GOTO CONTINUE
    :DELETEPASSWORD
    IF EXIST “%A%%B%%C%” ATTRIB -H -S -A “%A%%B%%C%” >NUL
    IF EXIST “%A%%B%%C%” ECHO Y|DEL “%A%%B%%C%” >NUL
    CLS
    ECHO Password deleted successfully . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :EMPTY
    ECHO.
    ECHO Empty Password!!!
    PAUSE>NUL
    GOTO CHANGEPASSWORD
    :NOTFOUND
    ECHO Can’t find “Folder Locker” password . . .
    ECHO.
    ECHO.
    ECHO.Recovery is uncompleted . . .
    ECHO.
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :SUCCESS
    FOR /F “TOKENS=*” %%A IN (%A%%B%%C%) DO SET %%A
    SET PASSWORD=%PWD%
    ECHO Recovery completed successfully . . .
    ECHO.
    ECHO.
    ECHO.Your Password Is : %PASSWORD%
    ECHO.
    ECHO.
    ECHO Press any key to continue . . .
    PAUSE>NUL
    GOTO CONTINUE

  26. Faid says:

    @ECHO OFF
    COLOR 1F
    MODE 47,6
    TITLE Folder Locker
    SET A=%MyFiles%
    SET B=Control_Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}
    SET C=FF41D262-C2A7-5795-89E4-00805F1408F3
    SET D=FDNME.BIN
    SET E=FDPWD.BIN
    FOR /F “TOKENS=*” %%A IN (%A%%B%%D%) DO SET %%A
    SET FOLDER=%NME%
    IF EXIST “%A%%B%%C%” GOTO CONFIRM0
    IF NOT EXIST “%A%%B%%C%” GOTO CONFIRM2
    :CONFIRM0
    IF EXIST “%A%%B%%E%” GOTO CONFIRM1
    IF NOT EXIST “%A%%B%%E%” GOTO NEWPASSWORD
    :CONFIRM1
    IF EXIST “%A%%B%%C%” GOTO UNLOCKCONFIRM
    IF NOT EXIST “%A%%B%%C%” GOTO LOCKCONFIRM
    :CONFIRM2
    IF EXIST “%FOLDER%” GOTO CONFIRM0
    IF NOT EXIST “%FOLDER%” GOTO CREATE
    :CREATE
    TITLE Folder Locker – [CREATE FOLDER]
    CLS
    ECHO Are you sure want to make new folder [Y/N]?
    ECHO.
    SET /P “CHOICE=¯ ”
    IF NOT DEFINED CHOICE GOTO CREATE
    IF /I %CHOICE% EQU Y GOTO CREATEFOLDERNAME
    IF /I %CHOICE% EQU N GOTO EXIT
    ECHO.
    ECHO Invalid Choice!!!
    PAUSE>NUL
    CLS
    GOTO CREATE
    :CREATEFOLDERNAME
    CLS
    ECHO Type name for your new folder.
    ECHO.
    SET /P “FOLDERNAME=¯ ”
    IF NOT DEFINED FOLDERNAME GOTO EMPTY4
    GOTO CREATING
    :CREATING
    CLS
    ECHO Please Wait . . .
    IF NOT EXIST “%A%%B%” MD “%A%%B%” >NUL
    IF EXIST “%A%%B%” ATTRIB +H +S +A “%A%%B%” >NUL
    IF NOT EXIST “%FOLDERNAME%” MD “%FOLDERNAME%” >NUL
    IF NOT EXIST “%FOLDERNAME%” GOTO UNABLECREATE
    IF EXIST “%A%%B%%D%” ATTRIB -H -S -A “%A%%B%%D%” >NUL
    IF EXIST “%A%%B%%D%” ECHO Y|DEL “%A%%B%%D%” >NUL
    IF EXIST “%FOLDERNAME%” ECHO.NME=%FOLDERNAME%>”%A%%B%%D%”
    IF EXIST “%A%%B%%D%” ATTRIB +H +S +A “%A%%B%%D%” >NUL
    CLS
    ECHO Folder created successfully . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :UNABLECREATE
    CLS
    ECHO Unable to create folder . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :EMPTY1
    ECHO.
    ECHO Empty Password!!!
    PAUSE>NUL
    GOTO CHANGEPASSWORD2
    :EMPTY2
    ECHO.
    ECHO Empty Password!!!
    PAUSE>NUL
    GOTO NEWPASSWORD
    :EMPTY3
    ECHO.
    ECHO Empty Name!!!
    PAUSE>NUL
    GOTO RENAME
    :EMPTY4
    ECHO.
    ECHO Empty Name!!!
    PAUSE>NUL
    GOTO CREATEFOLDERNAME
    :EMPTY5
    ECHO.
    ECHO Empty Name!!!
    PAUSE>NUL
    GOTO CREATENAME
    :LOCKCONFIRM
    TITLE Folder Locker – [LOCK FOLDER]
    CLS
    ECHO Type “RENAME” for rename your current folder.
    ECHO Type “CHANGE” for change your password.
    ECHO Are you sure want to lock your folder [Y/N]?
    ECHO.
    SET /P “CHOICE=¯ ”
    IF NOT DEFINED CHOICE GOTO LOCKCONFIRM
    IF /I %CHOICE% EQU Y GOTO LOCKING
    IF /I %CHOICE% EQU N EXIT
    IF /I %CHOICE% EQU CHANGE GOTO CHANGEPASSWORD1
    IF /I %CHOICE% EQU RENAME GOTO RENAME
    SET /P CHOICE=Invalid Choice!!!
    CLS
    GOTO LOCKCONFIRM
    :LOCKING
    CLS
    ECHO Please Wait . . .
    IF EXIST “%A%%B%%C%” ATTRIB -H -S -A “%A%%B%%C%” >NUL
    IF EXIST “%A%%B%%C%*” ATTRIB -H -S -A “%A%%B%%C%*” >NUL
    IF EXIST “%A%%B%%C%*” ECHO Y|DEL “%A%%B%%C%*” >NUL
    IF EXIST “%A%%B%%C%” RD “%A%%B%%C%” >NUL
    IF EXIST “%FOLDER%” MOVE “%FOLDER%” “%A%%B%” >NUL
    IF EXIST “%A%%B%%FOLDER%” REN “%A%%B%%FOLDER%” “%C%” >NUL
    IF EXIST “%A%%B%%C%” ATTRIB +H +S +A “%A%%B%%C%” >NUL
    CLS
    ECHO Folder locked successfully . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :RENAME
    TITLE Folder Locker – [RENAME FOLDER]
    CLS
    ECHO Type new name for your current folder.
    ECHO.
    SET /P “NEWNAME=¯ ”
    IF NOT DEFINED NEWNAME GOTO EMPTY3
    IF EXIST “%FOLDER%” REN “%FOLDER%” “%NEWNAME%”
    IF NOT EXIST “%NEWNAME%” GOTO UNABLERENAME
    IF EXIST “%A%%B%%D%” ATTRIB -H -S -A “%A%%B%%D%” >NUL
    IF EXIST “%A%%B%%D%” ECHO Y|DEL “%A%%B%%D%” >NUL
    IF NOT EXIST “%A%%B%%D%” ECHO.NME=%NEWNAME%>”%A%%B%%D%”
    IF EXIST “%A%%B%%D%” ATTRIB +H +S +A “%A%%B%%D%” >NUL
    CLS
    ECHO Folder renamed successfully . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :UNABLERENAME
    CLS
    ECHO Unable to rename folder . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :CREATENAME
    TITLE Folder Locker – [CREATE NAME]
    CLS
    ECHO Folder name is not set, type new folder name.
    ECHO.
    SET /P “NEWNAME=¯ ”
    IF NOT DEFINED NEWNAME GOTO EMPTY5
    IF NOT EXIST “%NEWNAME%” MD “%NEWNAME%” >NUL
    IF NOT EXIST “%NEWNAME%” GOTO UNABLECREATENAME
    IF EXIST “%NEWNAME%” RD “%NEWNAME%” >NUL
    IF EXIST “%A%%B%%D%” ATTRIB -H -S -A “%A%%B%%D%” >NUL
    IF EXIST “%A%%B%%D%” ECHO Y|DEL “%A%%B%%D%” >NUL
    IF NOT EXIST “%A%%B%%D%” ECHO.NME=%NEWNAME%>”%A%%B%%D%”
    IF EXIST “%A%%B%%D%” ATTRIB +H +S +A “%A%%B%%D%” >NUL
    CLS
    GOTO UNLOCKING
    :UNABLECREATENAME
    CLS
    ECHO Unable to create folder name . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :CHANGEPASSWORD1
    TITLE Folder Locker – [CHANGE PASSWORD]
    FOR /F “TOKENS=*” %%A IN (%A%%B%%E%) DO SET %%A
    SET PASS=%PWD%
    CLS
    SET PASSWORD=
    SET /P “PASSWORD=Enter Old Password : ”
    IF NOT DEFINED PASSWORD GOTO CHANGEPASSWORD1
    IF %PASSWORD%==%PASS% GOTO CHANGEPASSWORD2
    ECHO.
    ECHO Invalid Password!!!
    PAUSE>NUL
    GOTO CHANGEPASSWORD1
    :CHANGEPASSWORD2
    CLS
    ECHO Enter Old Password : OK
    ECHO.
    SET NEW=
    SET /P “NEW=Enter New Password : ”
    IF NOT DEFINED NEW GOTO EMPTY1
    IF EXIST “%A%%B%%E%” ATTRIB -H -S -A “%A%%B%%E%” >NUL
    IF EXIST “%A%%B%%E%” ECHO Y|DEL “%A%%B%%E%” >NUL
    IF NOT EXIST “%A%%B%%E%” ECHO.PWD=%NEW%>”%A%%B%%E%”
    IF EXIST “%A%%B%%E%” ATTRIB +H +S +A “%A%%B%%E%” >NUL
    CLS
    ECHO Password has been changed . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :NEWPASSWORD
    TITLE Folder Locker – [NEW PASSWORD]
    CLS
    SET NEW=
    ECHO Password is not set, type new password.
    ECHO.
    SET /P “NEW=New Password : ”
    IF NOT DEFINED NEW GOTO EMPTY2
    IF EXIST “%A%%B%%E%” ATTRIB -H -S -A “%A%%B%%E%” >NUL
    IF EXIST “%A%%B%%E%” ECHO Y|DEL “%A%%B%%E%” >NUL
    IF NOT EXIST “%A%%B%%E%” ECHO.PWD=%NEW%>”%A%%B%%E%”
    IF EXIST “%A%%B%%E%” ATTRIB +H +S +A “%A%%B%%E%” >NUL
    CLS
    ECHO New password has been set . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :UNLOCKCONFIRM
    TITLE Folder Locker – [UNLOCK FOLDER]
    CLS
    ECHO Are you sure want to unlock your folder [Y/N]?
    ECHO.
    SET /P “CHOICE=¯ ”
    IF NOT DEFINED CHOICE GOTO UNLOCKCONFIRM
    IF /I %CHOICE% EQU Y GOTO UNLOCK
    IF /I %CHOICE% EQU N EXIT
    ECHO.
    ECHO Invalid Choice!!!
    PAUSE>NUL
    CLS
    GOTO UNLOCKCONFIRM
    :UNLOCK
    FOR /F “TOKENS=*” %%A IN (%A%%B%%E%) DO SET %%A
    SET PASS=%PWD%
    CLS
    ECHO Type “CHANGE” for change your password.
    ECHO.
    SET PASSWORD=
    SET /P “PASSWORD=Enter Password : ”
    IF NOT DEFINED PASSWORD GOTO UNLOCK
    IF %PASSWORD%==%PASS% GOTO UNLOCKING
    IF /I %PASSWORD% EQU CHANGE GOTO CHANGEPASSWORD1
    ECHO.
    ECHO Invalid Password!!!
    PAUSE>NUL
    CLS
    GOTO UNLOCK
    :UNLOCKING
    CLS
    ECHO Please Wait . . .
    IF NOT EXIST “%A%%B%%D%” GOTO CREATENAME
    FOR /F “TOKENS=*” %%A IN (%A%%B%%D%) DO SET %%A
    SET FOLDER=%NME%
    IF EXIST “%FOLDER%” GOTO UNABLEUNLOCK
    IF EXIST “%A%%B%%C%” ATTRIB -H -S -A “%A%%B%%C%” >NUL
    IF EXIST “%A%%B%%C%” REN “%A%%B%%C%” “%FOLDER%” >NUL
    IF EXIST “%A%%B%%FOLDER%” MOVE “%A%%B%%FOLDER%” “.” >NUL
    CLS
    ECHO Folder unlocked successfully . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :UNABLEUNLOCK
    CLS
    ECHO Unable to unlock folder . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT

  27. shashi nitave says:

    It’s very nice.I like too much.

  28. Jay says:

    Hi.. I typed wrong password for few types and nothing happened. Now i know the password and opened the folder but I can not see data in the folder. If I go to properties of the main folder, I can see files size of the data, that means data is there but not seen.,. what to do now

  29. Hussain says:

    I have used .bat file to hide my folder and use your advises.
    It was really amazing and successful.
    But suddenly today morning there is an issue that when I double click the .bat file to show my hidden folder, it asking the password as usual but my hidden folder dose not showing me.
    Please help me about.
    Thanks and regards.

  30. Raj says:

    Hi I created a folder using notepad, now I don’t remember my password so i cannot open the folder please guide me to open the locked folder… Thank u…