Jump to content

Password protect a folder in windows


munkee

Recommended Posts

Although locking a folder isn’t the most secure way of protecting it, but it’s a fine method to have on hand in a pinch.

 

1- First, navigate to the folder you’re looking to restrict access to and create a new text document within it (right-click > New > Text Document)

2- Open that document up and paste the following string into the body

 

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

 

3- Replace the section of the text that reads your_password with an appropriate word or phrase, then navigate to File > Save As. Click the dropdown menu labelled Save as type and select All Files before naming the document Locker.bat

4- Once that document has been saved, exit and double click the .bat file to produce the locker folder, which can then be filled with the content you’re looking to protect. Open up the .bat file again and respond with Y when prompted to put your folder on lockdown. When you want to unlock it, simply open up that .bat file once more and input your password.

 

Link to comment
Share on other sites


  • Replies 1
  • Views 960
  • Created
  • Last Reply

I have never seen this before that I could recall so I got my wife up (she wasn't happy about getting up at 1:30 AM) and had her look at this and follow the instructions.  Now I know why I had never seen this before. Took all of 25 seconds to find the folder on her hard drive and open it and she tried to get smart and put it two levels deeper that the instructions said to place it.  She put it in My Videos\Old Videos\MISC\Locker.  The batch file just renames the folder and changes the attribute to H.  I was in a hurry so I used a program to search for all the hidden folders on the machine rather than making all of them visible using folder options and then manually looking for hidden folders.

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...