Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Autorun on USB's

Hi, my work have asked me to arrange for a USB to be filled with some files and a html page (with hyperlinks to the different files) to be automatically loaded when the USB is inserted.

The code I have found to be used is by creating an autorun.inf file and using the following code;

[autorun] open=filename.ext label=usbname

This isn't working (except for the label commant, this renames the name of the USB) , but I have had no success loading a file that is within the USB root directory - Any suggestions of achieving my brief would be greatly appreciated!

Many thanks, Ryan

4 Answers

Andrew McCormick
Andrew McCormick
17,730 Points

Bad news. More research shows this isn't possible anymore. Windows no longer allows autorun

Andrew McCormick
Andrew McCormick
17,730 Points

Ryan, First, you probably want your filename.ext to be filename.ex*e*
Second, is autorun disabled on the machine you are using it on?
Third, if you are testing on a Mac, you're out of luck. Mac's don't like autorun.

additional info: autorun on usb

Thanks Andrew,

I just used ext (short for extension) as an example - I have actually created an index.html - so my actual code reads;

[autorun] open=index.html label=PlantPRO

I have tried on XP, Windows 7 and on a MAC - No luck on any!

That's a bummer! I guess I will just place a html file in the root directory saying "start here" or something and use links within that to launch various applications/files