Hi,

I need to distribute my programs in a USB disk. I want to autorun the setup program. I have the Autorun.inf file in the root of the disk. But it doesn't work in XP. In Win2K works fine.

Here is my Autorun.inf:
[autorun]
open=setup.exe

The setup.exe also is in the root folder.

Can somebody please help me?

Thanks
SenPuppy

Dani AI

Generated

Short summary and root cause (for ): Windows XP does not always behave like Windows 2000 when you drop an installer on a USB stick. XP’s shell uses AutoPlay/AutoRun rules that treat removable USB volumes differently from optical discs, so a simple autorun.inf that worked on Win2K won’t reliably start an EXE on modern XP installs. The official Autorun.inf reference explains exactly which behaviors are honored for removable media and when the shell will present a launch option. (learn.microsoft.com)

Why it worked on some machines and not others: Microsoft and later security guidance changed the platform behavior over time. In 2009 Microsoft shipped updates that intentionally limited AutoPlay/AutoRun so that only CD/DVD media would present autorun actions by default; registry policies (NoDriveTypeAutoRun / related keys) also control whether AutoRun is allowed. Those updates and the CERT analysis are the reason a tweak that “used to work” may fail on patched XP machines — changing registry settings can re-enable behavior, but it carries real security risk. (learn.microsoft.com)

Practical, reliable options for distribution

  • Don’t rely on automatic execution from a plain USB stick. Provide a clearly named launcher (and a short README) so users can double-click the installer; sign the executable to reduce SmartScreen/AV prompts.
  • If autorun behavior is essential, only hardware approaches that make the device present itself as an optical (CD-ROM) device will work consistently (this is how older “U3” style drives achieved autorun). That approach has compatibility and support drawbacks and is not recommended for wide distribution. (support-in.sandisk.com)

Context for the thread: was correct to flag the security tradeoffs; ’s expanded autorun attempts explain why some fields show up on some XP installs but fail on others. For broad compatibility today, ship an installer users can launch manually or distribute on read-only media (CD/DVD) or via a signed download/installer. (learn.microsoft.com)

Recommended Answers

All 4 Replies

Did you ever solve the autorun problem on USB drive? I would be interested to know.

Hi guys,

I was looking for a similar solution to your issues and found a helpful link here:

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 ). 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, )

The link above has some other little tricks if you want true Autorun.

Hope that helps.

Regards,

Chris Fry

Also, for anyone who stumbled accross this forum looking for a free backup program for their USB drive (or backup program for thumb drive for the search engines), download the zip file and extract it to the root of your USB drive.

It will create a folder in your system drive (normally C: ) called "USB Backup 0707" and copy the contents of your USB drive there when you run it.

(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)

Hi,

I need to distribute my programs in a USB disk. I want to autorun the setup program. I have the Autorun.inf file in the root of the disk. But it doesn't work in XP. In Win2K works fine.

Here is my Autorun.inf:
[autorun]
open=setup.exe

The setup.exe also is in the root folder.

Can somebody please help me?

Thanks
SenPuppy

Hi,
i have same problem but i got solution only for xp & higher...
that is.. create one autorun.inf file..
[autorun]
open=filename.exe
icon=filename.ico
lable=heading
action=hai
shellexecute=filename.exe

its run only xp but not run in win98,2000
if u got any solution for this please send to me..

all the best.. do well...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.