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.
<HTA:APPLICATION
border="thin"
borderStyle="normal"
caption="no"
maximizeButton="no"
minimizeButton="no"
showInTaskbar="no"
WindowState="maximize"
innerBorder="yes"
navigable="no"
scroll="no"
scrollFlat="yes" />
</HEAD>
<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"
self.close()
End Sub
</script>
</BODY>
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.
OPEN=message.hta
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.
Nice implementation. But...
ReplyDeleteWhat 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...
Hi , please not that it do not work . Newer! Look this : Q: What must I do to trigger Autorun on my USB storage device?
ReplyDeleteThe 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 http://www.microsoft.com/whdc/archive/usbfaq.mspx)
Really nice. I will try this out.
ReplyDeleteThis simply does not work!
ReplyDeletei 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
ReplyDeleteyour dream idea of bringin the pd bac to the user is osum,which dint work practically..:(:(
ReplyDeletei lost my pendrive how can i find or corrupt that i dont want to use that others
ReplyDeletei lost my pen drive it contains huge data plz help
ReplyDeleteOh Please... Screw yourself n00b
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteWhat if it's lost and you did not put any security code or whatsoever on it? How will you find it back?
ReplyDeleteI 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
ReplyDelete