Hi guys,
I was looking for a similar solution to your issues and found a helpful link here: http://www.usbhacks.com/2006/10/25/h...-flash-drives/
From what I understand, USB Autorun is limited on Windows XP for security reasons. Autorun assisted, data theft is one security concern for example. The simplicity of reading and writing to basic USB drives and the reasonable amount of data they can hold makes them an ideal target for this (you could easily move a lot of confidential word files onto even just a 128 MB drive). When the user gets home and plugs their USB drive in, a trojan sends the confidential data to the attacker.
I wanted an automatic backup system for USB drives, so I made the three files attached (in
USB backup.zip). Feel free to use and modify my code if it helps (if you can't see the files, it's because they're hidden - open a Windows folder and click Tools, Folder Options, View tab, select "Show hidden files and folders", click OK).
1. Autorun.inf (a small configuration file with autorun information)
2. backup.bat (my program/script)
3. backup.ico (a pretty icon which is displayed in my computer)
While this
doesn't result in my program being executed as soon as the user plugs the drive in, it adds running my program to the list of options presented when the drive is plugged in.
(see attached screen shot, USB Autorun screen.png)
The link above has some other little tricks if you want true Autorun.
Hope that helps.
Regards,
Chris Fry