2

I'm trying to prompt users to run my installer, whenever they plug in my USB device. I'd like this to work on all (most?) Windows OSes.

I have an autorun.inf file in the root dir of my USB key with these contents:

[Autorun]
ShellExecute=setup.exe
Icon=setup.exe
UseAutoplay=1

It doesn't seem to do very much at all. Well... it does change the icon properly, but nothing gets executed and the user doesn't get any prompts. I've tried it on both Windows 7 and Windows Server 2003.

Any ideas?

user313724
  • 3,425
  • 4
  • 19
  • 15

1 Answers1

1

USB mass storage devices do not perform Autorun on Windows. You need to enumerate as a USB CD-ROM device in order to support autorun.

If you have a U3 capable USB drive, you can often replace the U3 data with your own CD image.

If this is a custom USB device, you will need to implement a composite device with the Mass Storage and USB CD-ROM device (or just the CD-ROM if you don't want to supporting writing).

Yann Ramin
  • 32,895
  • 3
  • 59
  • 82
  • 1
    Thank you. I googled around and some of the posts I saw implied it should work just fine even from USB. I guess I misunderstood them. – user313724 Jun 09 '10 at 17:20
  • I need to achieve this, can you provide any links on how to change the usb stick to be readable as a cd? Can you pop an iso on there or similar? – David Yell May 09 '11 at 15:11