Friday, 25 November 2011

How To Lock A Folder Using Notepad

How To Lock A Folder Using Notepad


1. Start--> Run --> Notepad and hit enter.
2. Now Copy below code and paste it in notepad

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

 Now Save Notepad as FolderLock.bat.

3. Now double click on FolderLock.bat file then a new folder named as Locker is created.
4. Save your files in Locker folder then again double click on the FolderLock.bat, a prompt is displayed.
5. To lock the folder(Locker) press "y " in the prompt, to unlock press "n"  in the prompt.

19 comments:

  1. Cool but how to put a password

    ReplyDelete
    Replies
    1. Replace "type your password here" with your password without ""

      Delete
  2. hey the locked folder shows up in cmd window though, that too opens without a password, anyway to beat that?

    ReplyDelete
  3. Good post. Something I like to know as well. I will tested that..
    how to hide folder

    ReplyDelete
  4. the entered password is visible type in cmd window. how to replace the password like dots......

    ReplyDelete
  5. after i closed the unlock folder while control panel folder will be appear.it is not locked..i want to secured folder lock.can u help fr me

    ReplyDelete
  6. Check this man http://harshpchacks.blogspot.com/

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. when i try to unlock the folder it appears as a control panel. I am unable to access contents of the folder. Please tell me why is this happening?

    ReplyDelete
  9. use this code for windows 7...i use this code,,it is 100% working...

    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%== Type_Your_Password_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

    ReplyDelete
  10. hi,i was try this method but wen i doable click the locker.bat file its asking Are you sure you want to lock the folder(Y/N)?i select Y.the folder locked.after again i click the locker.bat file in this time "Enter password to Unlock folder" message not appearing.
    what the problem? please help me.....

    ReplyDelete
  11. hi..i am using windows 8 & put all my data in a locker and lock it . After some days I again install windows 8 by removing the old. The lucker is in F drive. After installing the new windows 8 I can't open the lucker . When I put password the command is disappear and locker is not unlock . Plz help to unlock my important data..

    ReplyDelete
  12. It's a good way to free password protect folder. It works, I test. Thanks.

    ReplyDelete
  13. I have created the folder as you have mentioned. I used to lock it before by typing letter 'y' in the prompt window. Nowadays, I am finding that it is not at all locking despite responding to the prompt with the letter 'Y". It would be appreciated if helped in resolving this problem.
    Thank you

    ReplyDelete
  14. sir jiiiii tuseee to jhaaaammm hoooooo
    mjaa aaagyaa
    mai n sari drive hi lock kr di hai.......

    ReplyDelete