Password Protect Folder Without Using Any Software in Windows

Posted by

It is very important to hide the confidential data in Windows. Some time the data which are really private need to be secured from the third-party. We have already discussed about the data hiding and file security in previous articles. But this one can take your data protection to a whole new level, a more secured one.

Tip: Secure the folder containing private data without any password protection software.

We shall make a folder locked making password protected also hidden, so that any third-party can not access its contents. There are tons of software, available in the market to hide or lock your folder in Windows. But if some thing can be done without the help of a software then why should you use one? In this article, I’ve described the whole process to lock the folder by creating a simple Batch file.

How to create the batch file to lock a folder

1. Copy and paste the following codes in a notepad file.

 cls @ECHO OFF title Folder Confidential if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK if NOT EXIST Confidential 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 Confidential "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 the Password to unlock folder set/p "pass=>" if NOT %pass%== Replace this red portion by Your password goto FAIL attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Confidential echo Folder Unlocked successfully goto End :FAIL echo Invalid password goto end :MDLOCKER md confidential echo Confidential created successfully goto End :End 

[Download the text version of the code] [via Trap17.com]

2. Save the file as “Key.bat”. You are done. When you’ll double-click on the Key.bat file for first time, a folder “Confidential” will be automatically created. You can move all your confidential data in that folder.

Now to lock the folder just double click on the file “Key”. You will get a confirmation message in Command Prompt. Type “y” to confirm. Now the folder “Confidential” will be locked and hidden.

If you want to get access to the contents of the folder then again double-click on the batch file, you have created. Immediately you will be prompted to enter your password. After that you can get access to the folder “Confidential”.

By this process you can password protect the folder and no body can get access to the folder without the password. But still there is some risk. If some body is a computer savvy then he can easily retrieve the password from your batch file. He can easily find the password by choosing “Edit” option from the right-click context menu.

So, to prevent from that option you can make an executable file of the batch file. The facility of the executable file is that no body can’t see the source code of an exe file. Here I’ve described the process of converting the batch file to executable(.exe) file.

At first you need a compiler that compiles the batch file to an executable file.

1. Download Bat to Exe converter

2. Now run the application and put the source path of the batch file, then the target executable file name with location.

3. Click on “Compile” button.

That’s all. Delete the batch file “key.bat”. You can now protect or access the folder by using the exe file (key.exe). Your data is now fully protected.

The above method works in XP, Vista and Windows 7.

Update: After getting some feedback from the reader we modified the code and it should work properly. You can also get the code by clicking on the text version link.

While password protecting a folder ensures the security of important data, password protect images to make them private and inaccessible.

This post was written by Tanmay

Reader Comments

  1. Nice one. takes no load too

  2. Tanmay

    @NavaPavan
    This is for that I hate to use software for some cases.

  3. alok

    it doesn’t works with win7

  4. Tanmay

    @alok
    This definitely works in Windows 7. You can see that all the screen shots are given from Windows 7. I have tested it in Windows 7 and works fine. You can repeat the process very carefully.

  5. this is not working in window XP….

  6. Why its not working in XP??

  7. Mukesh

    It’s nothing like protection, it makes the folder as system hidden, which can be accessed easily.

  8. sweetdet

    This one work in XP..can I repost this blog in my site?
    http://bernadettediaries.blogspot.com
    Thanks.

    cls
    @ECHO OFF
    title Folder Confidential
    if EXIST \"Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}\" goto UNLOCK
    if NOT EXIST Confidential 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 Confidential \"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 \"cho=>\"
    if NOT %cho%== Replace this red portion by your Password goto FAIL
    attrib -h -s \"Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}\"
    ren \"Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}\" Confidential
    echo Folder Unlocked successfully
    goto End
    :FAIL
    echo Invalid password
    goto end
    :MDLOCKER
    md Confidential
    echo Confidential created successfully
    goto End
    :End

  9. WAQAR

    It does not work well in windows 7.
    If you go to options and uncheck the option of protected system files.The folder will appear.
    Please help.

  10. Tanmay

    @WAQAR: It works fine in Windows 7. Please take a look at the screen shots.

  11. Pulkit

    tnx……dude

    it helped a lot ………

    the new one works well in XP
    very good explanation

  12. Tanmay

    Welcome! Pulkit..

  13. aydin

    But there is a big problem.

    Anybody who know this method when made a .bat file like this and use any password can open this private file.
    For example i made a private folder and my password is 123 and private file unvisible.
    and then i delete this .bat file which was password is 123, and i create new one and password is nonpasaran.
    password “nonpasaran” can open the file which locked password 123 !

    Any idea?

  14. Thank you very much.

  15. Excllent Piece of code. Thanks for sharing :)

  16. herytety

    this would protect your files from people with average computer knowlage :D. thanks.

  17. :alit Bhardwaj

    It does not work with xp.

  18. WytaZzZ

    Hi, i have tried this method in windows 7. However this code does not work at all you should recheck your code. But the code in source which you wrote. http://www.knowledgesutra.com/forums/topic/55662-best-way-to-lock-a-folder-without-using-an-application/
    this worked well.

    By the way this is not secure. Open tools then folder options and select tab “View”. Then Uncheck: “Hide protected operating system files”. And you can freely and easily open that secured folder (however it is named something like “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”)

    So this is just a trick.

  19. vivek

    Great job man

  20. Fazlullah Khan

    It does work with Windows XP

  21. Adi

    Dude you really fail. I’m still able to access the file. You are just simply making it hidden.

  22. Tanmay

    Adi: You might not able to follow the instruction properly.

  23. parshu

    Hey dude the key.bat file is not workin properly…..my password is not workin. Can u plz tell me how to unlock it?….plzzzzzzzzzzzz

  24. parshu

    my password is not workin. Can u plz tell me how to unlock it?….plzzzzzzzzzzzz

  25. Aakash

    it doesn’t works with win7.
    When i click on ‘Key’ then command says “123 to unlock” but in your image it shows “Enter the password to unlock”

  26. Aakash

    And what to do if anyone Delete the icon “Key”

  27. Tanmay

    @Akash: Sorry for the mistake. I have made the correction. Now it should work fine. Thanks for your feedback.

  28. Tanmay

    Though you can recreate that unlocking key by the above codes. And if you can remember the password, you will be able to recover that folder. But keep that key file in such a place that any one can’t find that easily.

  29. Bhupi

    key.bat is not craeting the req. folder “confidential”.Kindly tell where it is created.

  30. Tanmay

    @Bhupi: Copy the code by clicking the “Download the text version” link at the above post. It should work.

  31. Amazing really amazing site!…i should go through every tips of this site to be genius hahaha!

  32. TAS

    Hi! My question is how to delete this .bat file completely and what if someone deletes the converted .exe too I mean then how will I get my stuffs back.

  33. Tanmay

    If your folder is unlocked then just manually delete the file from its location by pressing the Delete button.

    For you second query: If you can remember the password then you can again create that bat file or exe file from this site and follow the procedure of unlocking.

  34. TAS

    Yes, but I wanted to know whether or not the stuffs on the Confidential Folder will remain there or not

  35. i will try this at my home to protect my folders for the first time

  36. Anup

    thanks a,it woks well……

  37. sounak

    after selecting yes option d folder doesn’t bcome invisible ……. rather a shortcut to control panel is created …….. can any one help me?

  38. shardul

    Hi dude,
    Concept was good but you need to work more to avoid deletion of folder once it will locked

  39. Tanmay

    @Shardul: Thanks for the suggestion.

  40. anup

    it’s not working on window 7….in hidden files confedential folder is visible……….

  41. win7_advanced_user

    Works perfectly fine with win7. however, by going to organize-folder and search options-view, then hitting hide protected system files, the file can be revealed…

  42. NS

    Thanks ,worked like a charm on my windows7…

  43. Josie121392

    I made everything the way it says, I followed it step by step, and it works, but why is it that when I click to unlock the folder, where that little pop up appears about inserting the password, it doesnt ask me that, instead it GIVES me my password and all you have to do is press “y” and enter and it opens the folder.. Help me please??

  44. Manoranjan Mahapatra

    It works so well in windows xp
    Thanks Tanmay

  45. gaius

    I finished all the steps (1..2..3.) then I put my files inside the Confidential folder, then i converted bat to exe, but when i opened key.bat and key.exe by password my files are missing.
    Please someone help me to get my folder back!

  46. mostafa

    I have a question, how to prevent any1 from deleting the file (key) plz if anyone knows how , i would be very grateful thx…

  47. ali khan

    can you change the folder name from confidential to something else???

  48. Tanmay

    Yes Ali. Just replace the word confidential in the code with your desired name (make sure you replaced all)

  49. Disorder

    Nice easy and requires no software. But if someone delete this key file folder is lost, right? I tested it and i couldn`t reach this cofidential folder anymore after deleted hey file

  50. Lester

    can I rename “Confidential” to anything I want? ‘Cause there are 2 that I need to lock.

  51. Lester

    sorry. I know the answer. thanks.

  52. Minea Bogdan

    WORKS PERFECLY ON ANY WINDOWS! TESTED BY ME ON WINDOWS 2000, XP SP3, VISTA 64 BIT AND WINDOWS 7 32 BIT! THANK YOU VERY MUCH!

  53. qenezela

    works well on win 7,at first it didnt,one juz gotta do steps as outlined.
    still to check whether it is compromisable though

  54. sandeep

    good one!thankx for ur post

  55. gopal

    the folder that is locked, can be deleted by any body without asking password
    can u give me any suggessions

  56. sreenivas

    this is very nice folderlock thankyou verymuch. but anybody will delete the key.bat. so, i think this code is very fine if it is when undeletable file (key.bat)

  57. B Rhodes

    Other than that, for a ‘no software required’ protection, it is a very good solution.

    Yes, it can be gotten around, but by it being hidden, the folder is less likely to pique someone’s curiosity to try and see what is in it.

  58. ANI

    it doesn’t work wid windows xp.
    confidential folder opens on any password.

  59. rajiv

    in windows 7 folder is created
    but it gets opened even without password

  60. vishal

    hey guys….any idea ..how we can protect external USB hard drive data…i hav tried few softwares..but either they all are not working properly or the became trial versions…and hav limited use like 3-5 times.anybody hav USB secure with crack….working…pls do let me know guys..it will b great help…take care

  61. sajid

    the confidential can be seen without passwords.. waste of time..

  62. ricky

    nice, its really worked for me on windows 7 ultimate.

  63. samninder

    yes its working good then other

  64. Windows 7 Ultimate SP1 Here. It works perfectly on my PC. Thanks for sharing this tip: How to Password Protect Folder in Windows. More power!

  65. kk

    i need some code for exe file protection….

  66. Pank

    Thks buddy.

  67. Bijayananda Das

    Nice and easy but when one search the folder displays itself which should not.

  68. maddy

    hi TANMAY UR IDEA WORKS FOR ME IN WIN XP.THANKS:) BUT MY QUESTION IS THEIR ANYWAY TO CHANGE PASSWORD THROUGH MS-DOS COMMAND WITHOUT EDITING CODING PROGRAM.THANKS MADDY

  69. maddy

    TANMAY I READ THIS ARTICLE IN MANY SITES BUT I WAS UNABLE TO UNDERSTAND BUT AS OF NOW IAM FINE AS DUE HAVE ILLUSTRATED IN SUCH A SIMPLE AND GOOD MANNER…THUMPS UP FOR U KEEP IT UP

  70. Tanmay

    @Maddy: Thanks for your appreciation. Will try to integrate that feature so that the password can be changed with a dos command. Keep coming.

  71. vinceml

    U rock thanks

  72. prabhakar

    we have done it befor but with the help of software.

  73. SATISH

    HAI .CONCEPT IS GOOD AND VERY USE FULL ..BUT IT IS NOT WORKING GOOD .. I TRY THIS PROCEDURE IN WIN 7..ONE PROBLEM IS OCCURED .. THE CONFIDENTIOL FOLDER IS NOT APEAR .IN DOUBLE CLIK OF BAT FILE ..HOW SOLVE THIS PROBLEM???TELL ME SOLUTION IN MY MAIL SAT143@YMAIL.COM

    • lex

      Satish, In windows 7, you need to run the command as an admin for the changes to be made

  74. Youpz

    but why i click wrong pass the folder or file can still opened….???

  75. nnn

    how do i retrive the folder i locked ?
    as i m not getting Confidential folder after double click key.bat.
    i have recently formatted my computer.
    plz help me getting this folder

  76. sam

    If we hide a file lets say sam.jpg, it wont show up.
    But if we search sam.jpg, file is found even if its hidden.

  77. Med Y

    lol
    this tip is for kids and stupids.
    i can unlock it even without password.

  78. Noidea1993

    i accidentally deleted the folder where i hidden the folder..how do i retrieve it?

  79. Vikasgupta1970

    i lock the folder what is the password for unlock the folder. i do not change anything in the bat file
     

  80. Sharief Eee

    Yeah this look good, but as i heard in above comment that it’s still appear even if it is in hidden, if it’s in search it shows the folder over there. so hw to disappear form that is there is ny thing which the folder should be there and it should asked for password

  81. Ahmad Shakib

    I want your best comments in my e-mail.

  82. vanitha

    Hi It works good, but after I attach and send this file through the outlook email to other person, it goes to unlock. After that, the file retains in unlocked condition. How can we lock the file, after it is attached through email?

  83. shaks

    dear, but when the .bat file asks for password, even if i enter any incorrect password th3e folder gets disclosed, is thr some mistake in the code, or some other trick will do

  84. doll

    Hi tanmay,

    the key file will unlock the confidential with wrong password also.

  85. avg

    Hi Tanmay. Doll is right. key.exe-file unlocks the Confidential with ANY password!

  86. Jeffrey

    when it asks for the password and whatever I put it unlocks

  87. mike

    here is an simpler program that i am working on can you give me some advice about it???

    @echo off
    :start
    taskkill /f /im “explorer.exe”
    cls
    set /p Answer= Please enter password
    if /i {%ANSWER%}=={YOUR PASSWORD HERE} (goto :yes)
    goto :start
    :yes
    START explorer
    cls
    echo correct password
    pause

  88. Prakash

    Good .. Thanks a lot !

  89. Prakash

    But the key file will unlock the confidential with wrong password also.
    Please Help.. Reply on My Email. ID : s43prakash@gmail.com

  90. ganesh

    thanks it worked…. but while typing password it is visible…can you make it like ****** way

  91. Faid Alfarisi

    Try my edited version :
    - Save/Load password.
    - Can open folder in anywhere in same drive.
    - Rename folder

    @ECHO OFF
    COLOR 1F
    MODE 47,6
    TITLE Folder Locker
    SET A=%MyFiles%
    SET B=C2F41D69-E2A7-5795-89E4-00805FE4081D
    SET C=D4E221D2-3A5B-1069-52DD-06002B3A3098
    SET D=E65D24D8-98B5-68C0-BB82-010D30BDCE0C
    SET E=F89CDCE2-B7C3-28FF-A9F0-007A0060FC34
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:F /E >NUL
    IF EXIST “%A%%B%” ATTRIB +H +S +A “%A%%B%” >NUL
    IF EXIST “%A%%B%%D%” CACLS “%A%%B%%D%” /P EVERYONE:F /E >NUL
    IF EXIST “%A%%B%%E%” CACLS “%A%%B%%E%” /P EVERYONE:F /E >NUL
    IF EXIST “%A%%B%%D%” FOR /F “TOKENS=*” %%F IN (%A%%B%%D%) DO SET “FD=%%F”
    IF EXIST “%A%%B%%E%” FOR /F “TOKENS=*” %%P IN (%A%%B%%E%) DO SET “PS=%%P”
    IF EXIST “%A%%B%%D%” CACLS “%A%%B%%D%” /P EVERYONE:N /E >NUL
    IF EXIST “%A%%B%%E%” CACLS “%A%%B%%E%” /P EVERYONE:N /E >NUL
    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 “%FD%” GOTO CONFIRM0
    IF NOT EXIST “%FD%” GOTO CREATE
    :CREATE
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    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” 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 EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    IF NOT EXIST “%FOLDERNAME%” MD “%FOLDERNAME%” >NUL
    IF NOT EXIST “%FOLDERNAME%” GOTO UNABLECREATE
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:F /E >NUL
    IF EXIST “%A%%B%%D%” CACLS “%A%%B%%D%” /P EVERYONE:F /E >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 EXIST “%FOLDERNAME%” ECHO.%FOLDERNAME%>”%A%%B%%D%”
    IF EXIST “%A%%B%%D%” ATTRIB +H +S +A “%A%%B%%D%” >NUL
    IF EXIST “%A%%B%%D%” CACLS “%A%%B%%D%” /P EVERYONE:N /E >NUL
    IF NOT EXIST “%A%%B%%E%” GOTO SETPASS
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    CLS
    ECHO Folder created successfully . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :SETPASS
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    CLS
    ECHO Folder created successfully . . .
    ECHO.
    ECHO Press any key to set password . . .
    PAUSE>NUL
    GOTO NEWPASSWORD
    :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
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    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%” CACLS “%A%%B%” /P EVERYONE:F /E >NUL
    IF EXIST “%A%%B%%C%” CACLS “%A%%B%%C%” /P EVERYONE:F /E >NUL
    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 “%FD%” MOVE “%FD%” “%A%%B%” >NUL
    IF EXIST “%A%%B%%FD%” REN “%A%%B%%FD%” “%C%” >NUL
    IF EXIST “%A%%B%%C%” ATTRIB +H +S +A “%A%%B%%C%” >NUL
    IF EXIST “%A%%B%%C%” CACLS “%A%%B%%C%” /P EVERYONE:N /E >NUL
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >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 “%FD%” REN “%FD%” “%NEWNAME%”
    IF NOT EXIST “%NEWNAME%” GOTO UNABLERENAME
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:F /E >NUL
    IF EXIST “%A%%B%%D%” CACLS “%A%%B%%D%” /P EVERYONE:F /E >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.%NEWNAME%>”%A%%B%%D%”
    IF EXIST “%A%%B%%D%” ATTRIB +H +S +A “%A%%B%%D%” >NUL
    IF EXIST “%A%%B%%D%” CACLS “%A%%B%%D%” /P EVERYONE:N /E >NUL
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >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
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    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%” CACLS “%A%%B%” /P EVERYONE:F /E >NUL
    IF EXIST “%A%%B%%D%” CACLS “%A%%B%%D%” /P EVERYONE:F /E >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.%NEWNAME%>”%A%%B%%D%”
    IF EXIST “%A%%B%%D%” ATTRIB +H +S +A “%A%%B%%D%” >NUL
    IF EXIST “%A%%B%%D%” CACLS “%A%%B%%D%” /P EVERYONE:N /E >NUL
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    CLS
    GOTO UNLOCKING
    :UNABLECREATENAME
    CLS
    ECHO Unable to create folder name . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :CHANGEPASSWORD1
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    TITLE Folder Locker – [CHANGE PASSWORD]
    CLS
    SET PASSWORD=
    SET /P “PASSWORD=Enter Old Password : ”
    IF NOT DEFINED PASSWORD GOTO CHANGEPASSWORD1
    IF “%PASSWORD%”==”%PS%” GOTO CHANGEPASSWORD2
    ECHO.
    ECHO Invalid Password!!!
    PAUSE>NUL
    GOTO CHANGEPASSWORD1
    :CHANGEPASSWORD2
    CLS
    ECHO Enter Old Password : %PS%
    ECHO.
    SET NEW=
    SET /P “NEW=Enter New Password : ”
    IF NOT DEFINED NEW GOTO EMPTY1
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:F /E >NUL
    IF EXIST “%A%%B%%E%” CACLS “%A%%B%%E%” /P EVERYONE:F /E >NUL
    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.%NEW%>”%A%%B%%E%”
    IF EXIST “%A%%B%%E%” ATTRIB +H +S +A “%A%%B%%E%” >NUL
    IF EXIST “%A%%B%%E%” CACLS “%A%%B%%E%” /P EVERYONE:N /E >NUL
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    CLS
    ECHO Password has been changed . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :NEWPASSWORD
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    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%” CACLS “%A%%B%” /P EVERYONE:F /E >NUL
    IF EXIST “%A%%B%%E%” CACLS “%A%%B%%E%” /P EVERYONE:F /E >NUL
    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.%NEW%>”%A%%B%%E%”
    IF EXIST “%A%%B%%E%” ATTRIB +H +S +A “%A%%B%%E%” >NUL
    IF EXIST “%A%%B%%E%” CACLS “%A%%B%%E%” /P EVERYONE:N /E >NUL
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    CLS
    ECHO New password has been set . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :UNLOCKCONFIRM
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    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
    CLS
    ECHO Type “CHANGE” for change your password.
    ECHO.
    SET /P “PASSWORD=Enter Password : ”
    IF NOT DEFINED PASSWORD GOTO UNLOCK
    IF “%PASSWORD%”==”%PS%” GOTO UNLOCKING
    IF /I “%PASSWORD%” EQU “CHANGE” GOTO CHANGEPASSWORD1
    ECHO.
    ECHO Invalid Password!!!
    PAUSE>NUL
    CLS
    GOTO UNLOCK
    :UNLOCKING
    CLS
    ECHO Please Wait . . .
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:F /E >NUL
    IF EXIST “%A%%B%%C%” CACLS “%A%%B%%C%” /P EVERYONE:F /E >NUL
    IF NOT EXIST “%A%%B%%D%” GOTO CREATENAME
    IF EXIST “%A%%B%%D%” CACLS “%A%%B%%D%” /P EVERYONE:F /E >NUL
    IF EXIST “%A%%B%%D%” FOR /F “TOKENS=*” %%F IN (%A%%B%%D%) DO SET “FD=%%F”
    IF EXIST “%A%%B%%D%” CACLS “%A%%B%%D%” /P EVERYONE:N /E >NUL
    IF EXIST “%FD%” GOTO UNABLEUNLOCK
    IF EXIST “%A%%B%%C%” ATTRIB -H -S -A “%A%%B%%C%” >NUL
    IF EXIST “%A%%B%%C%” REN “%A%%B%%C%” “%FD%” >NUL
    IF EXIST “%A%%B%%FD%” MOVE “%A%%B%%FD%” “.” >NUL
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    CLS
    ECHO Folder unlocked successfully . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT
    :UNABLEUNLOCK
    IF EXIST “%A%%B%%C%” CACLS “%A%%B%%C%” /P EVERYONE:N /E >NUL
    IF EXIST “%A%%B%” CACLS “%A%%B%” /P EVERYONE:N /E >NUL
    CLS
    ECHO Unable to unlock folder . . .
    ECHO.
    ECHO Press any key to exit . . .
    PAUSE>NUL
    EXIT