How to Put a Password on Any USB Flashdrive

143,788

36

18

Posted

Introduction: How to Put a Password on Any USB Flashdrive

The following steps are a great way to put a password on any USB flash drive. The following is a .bat file and is fairly simple to make. [Only works on windows]

This also works on regular windows files. Just adapt the steps to the folder you want to hide instead of the flash drive.

Warning:

I am not responsible for any lost and corrupted files. I highly suggest you back up your files before continuing.

Step 1: Move Your Folders

First, plug in your drive, and go to the flash drive's folder. Then create a new folder. Lets name this folder "Lock." Now move all the files you wish to hide into "Lock." Make sure "Lock" is still on the flash drive.

Step 2: Hide Your Folder

Now,open CMD (if you don't know what this is and want to learn check out my instructable on it) type in "g:" hit enter and type "attrib Lock +s +h" (if you have a different folder name instead of "Lock" use the name of your folder) this should now make you folder "disappear." The folder is now invisible. Although still accessible, it cannot be seen unless the specific folder path is typed in.

Step 3: Actual Batch Coding

Open notepad and paste the following script:

____________________________________________________________________________________

@echo off
title Orange Shadow's Folder Lock set pass= passwordlock

color a

echo----Enter Password----

set /p ui= if %ui%==%pass% (goto open)

echo Wrong Password pause

exit :open start Invisible

_____________________________________________________________________________________

There are two variables here: pass, where it says "set pass=passwordlock" change passwordlock to what you want your password to be.

Then there is "Invisible" Go ahead and change the name to what your new folder's name is.

Save this script as a .bat file. To do this, go to save as, and after the name of the title, type ".bat" For example, "Password.bat"

Save this where ever you want

Step 4: Voila

Now, to access that hidden folder, open the bat file, enter the password, and the hidden file will now open.

Step 5: Turning Into an .exe

The thing about having a .bat file is that you can easily edit the coding, making it accesbile to anyone. really Making this entire project more of a novelty than anything else.

However, There is a solution. Turning the .bat in a .exe (executable program).

To do this click this link here and download the program (or use any other .bat to .exe converter you wish). Follow the procedures, and you should be set.

Share

  • before the set/p... ...-RasmusK6

    RasmusK6 made it!

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • First Time Author Contest 2018

    First Time Author Contest 2018
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

11 Comments

Hi, I was viewing this and made flether-1's version a little easier to use

@echo off

title Drive Locked

color 2

:0

echo================= & echo Enter Password & echo ================

set /p password=

if %password%==YOURPASSWORDHERE goto :1

echo Wrong Password

pause

goto :0

:1

echo Success!

pause

(START \YOURFOLDERNAMEHERE)

Oh my god thank you so much for this updated version. I used the other one and couldn't open my file and spent several hours trying to fix it myself before looking through these. The original kept givving me error mesages.

i used this code. thanks bro.

i typed g: in cmd but its says

The system cannot find the drive specified.

pahelp naman po pls. sa thesis namin need po namin ng codes para malock ung external hard drive then dapat di pwede mareformat hanggat mali ung password. thank you ??

Fixed his code and made some adjustments if anyone is interested. Just change the bold "test" to whatever you want your password to be and change the E:\Files to the drive letter and folder name.

@echo off
title Drive Locked
color b
echo================= & echo Enter Password & echo ================

set /p password=
if %password%==test (START E:\Files)

echo Wrong Password pause

exit :Files

i encounter error.. "Enter is not part of external or internal command" :'(

where do i need to save the notepad i created? do i need to have the program installed?