Secure Your Thumb Drive With Batch




ever wonder how to keep your secret files a secret without buying those expensive programs. Well here is how to do it for free using windows dos and notepad

this a easy way to hide and secure the files on your thumb drive

note this does not completely secure your files it only hides them from prying eyes

also check out my other instructable

Batsignal in batch


Step 1: Chose Your Thumb Drive

it can be any size brand or shape

Step 2: Create a Folder in the Thumb Drive

start by creating a folder and name it "lockbox" (without the quotes)

Step 3: Add Your "secret" Files Into the Folder

move any files you want to into the folder

Step 4: Go to Computer Menu

go to the computer menu where you can see the drives name

now when you look at the name you see the letter in parentheses to the right remember that letter

(this letter represents the USB port your drive is plugged into) (lets say its z)

Step 5: Open Notepad

copy the following into notepad

(only whats in between the lines of equals)


@echo off


attrib lockbox +h


remember the letter from the last step replace Z below with that letter ( just the letter )

now name it " hidelockbox.bat " without the quotes and below it click on save as all files and then save it to your desktop

Step 6: Double Click on Your Batch File " Hidelockbox "

run the batch file you just created and go back to the my computer menu and open your thumb drive the folder named " lockbox " should be invisible (not gone but invisible)

Step 7: Create the Lock File

now download the following open it and at the bottom of the file there is the letter z again you need to replace it with whatever letter you found in step 4

then at the top of the file you will see " themostsecurepassword "

that is the password feel free to change it to whatever you want

save it as " lock4.bat " on the thumb drive

Step 8: Now Run the Batch File " Lock4 "

simple now run the file and it will ask you for the password, enter the password and it will grant you access to your secret folder

go back to your desktop and delete the batch file " hidelockbox " becouse it is no longer needed

congrats you now have a secure thumb drive



    • Party Challenge

      Party Challenge
    • Woodworking Contest

      Woodworking Contest
    • IoT Challenge

      IoT Challenge

    9 Discussions


    4 years ago on Introduction

    Warning: For anyone looking for actual file security do not use this instructable, but rather seek a encryption software like truecrypt on Windows, or cryptsetup on Linux. It simply adds the hidden flag to a directory, in which is easily bypassed by setting "show hidden files, folders, and drives" from within the folder options of windows. Not to mention any Linux OS which mounts the drive will not care if there is a hidden flag on the folder.

    3 replies

    Reply 4 years ago on Introduction

    this is true but it secures it from people most people that don't know their way around it


    Reply 3 years ago on Introduction

    I would think if anyone was trying to get into your USB they would probably know a little bit about how to use a computer. Also I'm pretty sure if you highlight everything in a folder with CTRL+A, and then press the delete button Windows notifies you that n number of files are hidden.

    If you are looking for something free, you can always use BitLocker (it's built into some versions of Windows) or TrueCrypt.

    1 reply