Monday, June 8, 2009

Creating an Autorun CD or DvD

How can you easily install the Autorun feature on a CD or DvD?

Earlier today I was asking myself this very question. Wow, who knew this could be so easy? How I've managed to go this many years working in the IT field without creating a single Autorun CD is beyond me but as of today I finally know how and I'd like to share that information with all of you.

Truth be told I'm not a big fan of the Autorun feature on windows machines (I now primarily use the OSX partition on my MacBook Pro) but in cases where you need to distribute functional copies of websites (or other media) to clients via CD this is something good to know. Computer users are becoming more and more savvy every day but there are still heaps of people out there who may not know that opening the index.html file located on the root level of the CD will open the site. Using Autorun can eliminate some initial confusion and help make the disk distribution more successful.

We'll create two text files to achieve the desired result: (autorun.inf and autorun.bat)

Note: You cannot tell an autorun to directly open a HTML file. This is why we have the .bat file as well, to serve as the "middle-man". Windows will treat the .bat file as a program, run it, and in turn the .bat file will open our index.html page.

Contents of autorun.inf
[autorun]
open=autorun.bat

Contents of autorun.bat
@echo Loading CD
@start index.html
@cls
@exit

Once both of these files are created, place them in the root of your local website folder (this is where your index.html file should also be located) Now simply burn the contents of your local website folder (including the two new files we created) to disk. When you pop the disk into a windows machine it should automatically load the index.html page in the machines default web browser. It's as simple as that.

Can you use autorun for other file types?
Absolutely! Alternatively you could use this same process to autoload a flash presentation, game, excel spreadsheet, or anything else (as long as the required software is loaded on the target machine). Simply modify the line @start index.html, replacing index.html with whatever file you want to automatically load.

It's worth noting that this process won't work on Macs or Linux machines. I'll have to sort that out in another post.

0 comments: