How to get your lost pen drive returned to you

Pen drives are so small that they can be easily misplaced and even lost. How do you make sure that your lost drive is returned to you by the finder? Leave you name and contact info in the drive? Yes, but we will do it a different way. First we will look at a software that displays a message when a pen drive is accessed, and then we will implement the same thing with our own coding.

USB Lost and Found is an interesting piece of software that informs the finder of a lost pen drive about the rightful owner of the drive. The free edition of this software can display a user configured message whenever the USB drive is accessed.


The tool is actually quite simple: it creates an executable application called “setup.exe” on the root of the pen drive, that displays an alert box with the owner’s email or phone number, and then causes this application to auto launch by creating an auto.ini file. The program is basic and does not prevent anybody from keeping the drive. The programs executable along with the autorun file can be simply removed and the thumb drive kept. However, there is a fair chance that a good citizen will return the drive to you.


USB Lost and Found pro version is different and provides a layer of protection to your pen drive by enabling you to password protect it, in addition to the reminder message. A “Locked Down” pen drive is inaccessible without the password and hence useless, and so he or she is likely to contact you and have it returned. At a price of $3.5 it is quite cheap. (Thanks gHacks)

Now the fun part: let’s make a pen drive display a message whenever it is plugged into the computer without using USB Lost and Found or any software.

Copy the following code, paste it in Notepad and save it with the extension .HTA.

scrollFlat="yes" />

<body STYLE="filter:progid:DXImageTransform.Microsoft.Gradient

(GradientType=0, StartColorStr=’#000000′, EndColorStr=’#0000FF’)">
<script language="VBScript">
    Sub Window_onLoad
        Msgbox "This USB drive is lost. Please contact XXX to have this returned. Thanks"
    End Sub


Replace the line within quotes next to Msgbox with your own message. You can also change the background color and even add a background image to it. The parameters inside the <HEAD> and <BODY> tag are self explanatory. It’s all HTML.

Create another file called autorun.ini and paste the following lines. Replace ‘message.hta’ with the file name of the HTA file you created in the previous step.


Copy both the autorun.ini and the HTA file to the root of the pen drive. Now every time the pen drive is accessed, it will make the complete screen go blue and display your message.


Pretty cool, huh? To make it a little hard for the finder to figure out what’s going on, make both the files hidden. Read more about coding HTA applications.

This Article Has 13 Comments
  1. Unknown Reply

    Nice implementation. But…

    What if finder is a Linux user. What if he or she block autorun-mode of removable devices in Windows.

    But topic is useful. 🙂 I loast my drive in bus a month ago…

  2. Ant Lan Reply

    Hi , please not that it do not work . Newer! Look this : Q: What must I do to trigger Autorun on my USB storage device?
    The Autorun capabilities are restricted to CD-ROM drives and fixed disk drives. If you need to make a USB storage device perform Autorun, the device must not be marked as a removable media device and the device must contain an Autorun.inf file and a startup application. (from

  3. Anonymous Reply

    Really nice. I will try this out.

  4. Anonymous Reply

    This simply does not work!

  5. Anonymous Reply

    Not working…… Stupid coding

  6. Anonymous Reply

    i forget my key of my pendrive & i lost my pendrive 1 day ago its contains huge important files & the software is asking key can anyone help me through this …its very important for me please

  7. Anonymous Reply

    your dream idea of bringin the pd bac to the user is osum,which dint work practically..:(:(

  8. Anonymous Reply

    i lost my pendrive how can i find or corrupt that i dont want to use that others

  9. Unknown Reply

    i lost my pen drive it contains huge data plz help

  10. Unknown Reply

    This comment has been removed by the author.

  11. Anonymous Reply

    What if it's lost and you did not put any security code or whatsoever on it? How will you find it back?

  12. Unknown Reply

    I have a mobile shop n someone stolen my all new unused pen drives n …is it possible to trace the location of my pen drives…. Plz reply fast

Leave a Reply

Your email address will not be published. Required fields are marked *