Locking a Folder

Locking a Folder

In this tutorial I'm going to be showing the simplest method of locking your folder using a batch file.


  • Step 1 - Go to the Folder you want to lock. Double click to open the folder.
  • settings
  • Step 2 - Inside the folder, Right Click (this opens a menu list) move down to New (this displays another menu list). Then move to Text Document and click on it to create new text document file.
  • settings
  • Step 3 - After creating the text document you can rename it with any name you wish. (Preferable password)
  • settings
  • Step 4 - Double click the text document to open it on notepad app, then copy and paste the following inside this text document file.
  • 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
  • Step 5 - After copying and pasting the following batch file above, go to where you will see TYPE_YOUR_PASSWORD_HERE edit this place and put the password you want here.
  • note
    NOTE:

    If you don't replace this text with your own password, your password will be TYPE_YOUR_PASSWORD_HERE

    settings
  • Step 6 - Click on the File move down to Save as. Click on it. (After this, file explorer will open for you to save your file)
  • settings
  • Step 7 - On the file explorer save as page, click on the file name input field and type in the name you want. (E.g. locker). Then at the end of the file name add .bat to it. (E.g. locker.bat).
  • settings
  • Step 8 - Click on the Save as type and change it from Text Documents *.txt to All file (*.*)
    Click on the Save button below this to save and exit.
  • settings
  • Step 9 - Go to the batch file you just saved and Double Click on it. (This will create a folder called Locker).
  • settings
  • Step 10 - Move all files you want to lock inside the Locker folder, and make sure to delete the other text document named password if it is still there.
  • settings
  • Step 11 - Double click on the batch file. This will open your command prompt ask you for confirmation to lock the folder.
    Type Y and hit Enter on your keyboard (this will automatically hide the Locker folder and leave only the batch file there.)
  • settings
    settings
  • Step 12 - Your folder and it documents has been locked successfully!
  • Step 13 - To unlock the folder, Double Click on the batch file again. This will bring out the command prompt asking you to input your password.
    Type in your password and hit Enter on your keyboard. (This will automatically display the Locker folder where your files and documents are). Your folder has been successfully unlocked!
  • settings
    settings

CONCLUSION

In this tutorial I believe you have been able to see how you can lock a folder in your computer system using a batch file.

In the next tutorial, I will be showing you how to set your date and time

ADVERTISEMENTS

LEARNING IS A CONTINUOUS PROCESS - PRACTICE MAKES PERFECT