Join 3,382 readers in helping fund MetaFilter (Hide)


Autorun an HTML file from USB pen drive?
July 26, 2008 6:23 PM   Subscribe

How to autorun an HTML file from a USB pen drive?

I am creating an HTML presentation to put on a USB pen drive/laser pointer. It will be a marketing tool, given to customers and contain information regarding our company. I want the index.htm page to open automatically when the drive is inserted into a USB port. I thought I could simply create an autorun.inf file, even tried that and a launch.bat file, but it didn't work. What am I doing wrong here? Is this even possible?
posted by momzilla to Computers & Internet (5 answers total) 3 users marked this as a favorite
 
Is AutoPlay disabled for the drive? With the flash drive connected to the computer that will be running the application, open My Computer and right-click on the drive. Select Properties from the context menu and go to the AutoPlay tab. Set all content types to "Prompt me each time to choose an action" clicking apply after setting each one. (You may not need to do this part, so try without doing it first as this can be done at any time.)

Now make sure your Autorun.inf file has content similar to this:

[Autorun]
Open=mybatchfile.bat
Action=Start Presentation

You can include more fields like one for an icon and one to label the drive by they arn't needed. Place this in the root of the flash drive.

Next, your mybatchfile.bat should also be in the root of the flash drive and have content similar to this:

start presentation.html

The presentation.html file should be in the root of the flash drive.

Now insert the flash drive into the computer that will run the presentation. You should get the window asking what you want to do. Click Start presentation and it should run the batch file and open the html file.
posted by ChazB at 7:00 PM on July 26, 2008 [1 favorite]


Might this be of help to you? Lifehacker.com Hack Attack: Quicklaunch your USB workspace
posted by Deflagro at 7:01 PM on July 26, 2008


What's the problem you're having? Maybe autorun needs an .exe file?

Could you put a portable browser (portable Firefox) on the drive, set the local html file as the default homepage, and set autorun to start Firefox?
posted by Alabaster at 7:14 PM on July 26, 2008


ChazB, that did the trick! I did try this earlier, but I was only setting the "Mixed Content" file type to prompt me each time, rather than setting *all* content types to prompt me. Wish I had asked this question much earlier today! Thanks for sharing.
posted by momzilla at 8:16 PM on July 26, 2008


Note that if this is inserted into a (potential) client's computer, it will only autorun if they've set up their USB drives to autorun. Since some will have done that, and some won't, you may wish to explain to clients that they'll may have to navigate to the drive and open the index.html file.
posted by orthogonality at 11:38 AM on July 27, 2008


« Older MacBook Pro screen weirdness -...   |  Should I ask my "friend&q... Newer »
This thread is closed to new comments.