7 Steps to Lock a Folder (Plus a BONUS)

July 20, 2015 | Views: 6233

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATIONAlready a Member Login Here

7 Steps to Locking a Folder (Plus a BONUS)

1.Open Notepad. Copy and paste the code below:

cls

@ECHO OFF

title hacking

if EXIST “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” goto

UNLOCK

if NOT EXIST MyFolder goto MDMyFolder

:CONFIRM

echo Are you sure to lock this 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 MyFolder “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 Your Secure Folder

set/p “pass=>”

if NOT %pass%== coolhacks goto FAIL

attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”

ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” MyFolder

echo Folder Unlocked successfully

goto End

:FAIL

echo Invalid password

goto end

:MDMyFolder

md MyFolder

echo MyFolder created successfully

goto End

:End

 

2.Save the Notepad file as lock.bat (.bat extension is a must).

3. Double-click the lock.bat file and a folder called “MyFolder” will be created.

4. Copy the data you wish to secure into “MyFolder”.

5. Double-click the lock.bat file again and when the tcommand prompt appears, type “Y” and press Enter.

6. “MyFolder” will remain hidden from view and to access it, double-click lock.bat file.

7. You’ll be prompted for a password. The default password is coolhacks. To change the password replace coolhacks with new password in the above code.

 

BONUS: More Folder Security

You may be thinking that anyone could access the password by opening that lock.bat file in Notepad or any other text editor. To make this folder more secure, hide the lock.bat file in a highly secure location after following the above tutorial.

Then, to access the secured file double click on the lock.bat file. Consider copying the lock.bat file into a Pendrive and then copying it onto your computer whenever you need access to your protected files.

Share with Friends
FacebookTwitterLinkedInEmail
Use Cybytes and
Tip the Author!
Join
Share with Friends
FacebookTwitterLinkedInEmail
Ready to share your knowledge and expertise?
33 Comments
  1. It created ‘Myfolder’ but if any files were kept in that ‘MyFolder’ it does not prompt for password.

  2. Really not working

  3. This “Hack” is stupid and useless. You’re not actually putting a password on the folder. All you are doing is renaming the folder and changing the attributes of the folder to make it hidden and a system file. This can be circumvented by simple CLI command to show hidden system files with a simple directory search:

    C:\> dir C:\Users\ /A:H /B /S

    C:\Users\XXXXXX\Desktop\Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}
    The above file was “Protected” with the “Hack” above.
    —————————————————————

    Or if you don’t have access to the system, spin up a Linux boot disk and take a look.

    The only password required here is one implemented by the script is a simple if/else statement to determine if you can run the commands to make the file visible again. This “Hack” is misleading in the actual level of protection it offers. You would be just as “Protected” by simply putting the file in some out of the way location and hiding it.

    You can test out his effectiveness of this password by going through the steps to create the “locked” folder as outlined, then open a terminal, navigate to the directory you created the file and run the following commands:

    attrib -h -s “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”

    ren “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}” “MyFolder” <—-Whatever you named your folder in the script.

    And bam, there is your "locked" folder, no password required. 🙂

    Please do not take this content with more than a token grain of salt. The only benefit may be in helping those unfamiliar with scripting to decipher what this script ACTUALLY does.

  4. NOT WORKING

  5. Try this it works 100% i also tried it. The default password is 1234

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

Page 5 of 5«12345
Comment on This

You must be logged in to post a comment.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Support Cybrary

Donate Here to Get This Month's Donor Badge

 

Cybrary|0P3N

Is Linux Worth Learning in 2020?
Views: 335 / December 14, 2019
How do I Get MTA Certified?
Views: 927 / December 12, 2019
How much does your PAM software really cost?
Views: 1380 / December 10, 2019
How Do I Get into Android Development?
Views: 1758 / December 8, 2019

We recommend always using caution when following any link

Are you sure you want to continue?

Continue
Cancel