Sunday, November 7, 2010

Create your own autorun CD or DVD

Create your own autorun CD or DVD
 
It is easy to create an autorun CD or DVD for Windows and all it takes are a few files (which we've supplied for free). The technique can be used to open other file types, but HTML is used for a reason: it is the most commonly supported by Windows (most PCs have a Web browser) and it is flexible. You could use it to open other files, such as a Powerpoint presentation, but it would require the end user to have Powerpoint or the Powerpoint viewer on their system.

The autorun zip file we've prepared contains everything you need to autorun a CD and open a HTML file. So download a copy - it's tiny and free - see above for the download link.


So why can't an autorun open a HTML directly? It is because a Windows autorun can only open an application (program) not a data file (eg HTML). You cannot tell an autorun to directly open a HTML file. Try it, and nothing will happen. To get around his problem, we are using a .bat file which Windows will treat as a program. This special file will then open the HTML file.

Assembling the CD
Download and copy the files to your root directory of the CD. These are: autorun.inf, autorun.bat and index.html. You can put all sorts of files on the rest of the CD. They won't affect the autorun. You can test the autorun by burning the three files to the root directory of a test CD-R. Open the CD drive and close it again. Viola, you have just created your own autorun HTML CD. You should change the contents of index.html to whatever you need. The index.html supplied is only a test page.


Changes you can make
The autorun can open any type of file and display any message you want. To make changes, open Windows Notepad (do not use Word, WordPad or other Word processors). Now open the autorun.bat file from within Notepad. The order is important, if you double-click the autorun.bat file, it will try to run. So open NotePad and select File-Open and choose the autorun.bat file. You'll see four lines of code.

The first line after @echo (remember the space) will appear as a comment in the autorun launch Window. This comment will be seen very briefly by your end-users. It can be changed to anything you want, but since it only appears for a second or less, don't make it too wordy. If you wanted to say 'The CD is loading now...', the first line of code will look like:

@echo The CD is loading now...

The second line of the code tells the .bat file to open to your index.html file. If want to open a file by another file (eg readme.txt), then it would read:

@start readme.txt

Make sure you leave the last two lines untouched (@cls and @exit) - they must always appear last. Save the changes and you are done. That that's all you need to create your own HTML autorun CD.

No comments:

Post a Comment