How to Setup and Bypass a Protected File Using CMD

Introduction: How to Setup and Bypass a Protected File Using CMD

In this instructable, you will be learning how to setup and bypass a password protected file which using the Command Line or "Command Prompt".

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Creating a Password Protected File Using CMD!

1. Go ahead and open a fresh document in notepad or notepad++ (downloadable).

2. Copy the following text, changing all words in [BRACKETS] to your preffered choice/word.



title Security

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

if NOT EXIST MyFolder goto MDMyFolder


echo Are you sure you would like 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.



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

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

echo Folder Locked.

goto End


echo Enter password to Unlock your Secure Folder

set/p "pass=>"

if NOT %pass%== [PASSWORD GOES HERE] goto FAIL

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

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

echo Folder Successfully Unlocked.

goto End


echo Invalid Password.

goto End


md MyFolder

echo MyFolder created successfully

goto End


3. Please note, if there are any bugs or the lock seems to be not working please comment below.

You can alternatively change the name of the "secret" folder by changing all accounts of MyFolder

to your preferred "secret" folder name.

Step 2: How to Bypass a Password Protected File Which Uses CMD.

Not many people know how to bypass this type of password protected file, unless they are tech savvy. Remember, bypassing is still easy and POSSIBLE! This step is for Educational Purposes ONLY! I am NOT RESPONSIBLE if you find yourself dealing with the police.

1. Select and right-click the batch file (command prompt).

2. Select Edit.

3. You will now see a most-likely gibberish language, which enables us to run this password protect.

4. Scroll down to the :UNLOCK section of the text file.

5. You will then see a line of text, or "command/code" which will say: if NOT %pass%== [PASSWORD DISPLAYED HERE] goto fail

6. Now go back and run the batch file. In the previous step, you obtained the password to enter the "secret" folder. Use this password to enter through the password system.

7. Walaahhh! You have now gained access to the "secret" file/folder.

Be the First to Share


    • LED Strip Speed Challenge

      LED Strip Speed Challenge
    • Sculpting Challenge

      Sculpting Challenge
    • Clocks Contest

      Clocks Contest

    3 Discussions


    Question 1 year ago on Introduction

    what do you save it as? as .bat or .cmd


    Answer 1 year ago

    you'd need to save it as .bat


    4 years ago

    Thanks for sharing!