lock folder with password without any software on windows


There are a few methods to lock a folder on Windows without using any software. Here are a few methods:

Method 1: Password-protect the folder using a batch file

  1. Open Notepad.
  2. Copy and paste the following code into Notepad:
    @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 you want to lock this folder? (Y/N)
    set/p "choice=>"
    if %choice%==Y goto LOCK
    if %choice%==y goto LOCK
    if %choice%==n goto END
    if %choice%==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%==yourpasswordhere 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
    
  1. Replace "yourpasswordhere" in the code with your desired password.
  2. Save the file with a .bat extension, such as "folderlock.bat".
  3. Double-click the batch file to run it.
  4. Type "Y" and press Enter to lock the folder.
  5. The folder will now be hidden and inaccessible without the password. To unlock the folder, run the batch file again, type the password, and press Enter.

Method 2: Hide the folder using the attrib command

  1. Open Command Prompt by typing "cmd" in the search bar and selecting "Command Prompt" from the results.
  2. Navigate to the directory containing the folder you want to hide by using the "cd" command.
  3. Type "attrib +h +s [folder name]" without the quotes, replacing "[folder name]" with the actual name of the folder.
  4. Press Enter to execute the command.
  5. The folder will now be hidden and inaccessible without the password. To unhide the folder, repeat the steps but replace the "+" with a "-" in the command.

Post a Comment

what you think about this article?

Previous Post Next Post