Site hosted by Angelfire.com: Build your free website today!
Making A CD Autostart
An .HTML File

Read this entire page before doing anything else.

A link to my tutorial on making self-contained html documents is provided at the bottom of this page.

You will need to know how to make a self-contained html document to add to your CD.

I am using Windows XP Pro.

All the screenshots open in fully functional new windows.

Click on the maximize button in the upper right corner or drag the sides to see them bigger.

Click on the close button in the upper right corner (X) to get rid of them.

It is better to close one screenshot before opening another.

This is one of the most complex tutorials I have ever tried to present.

It is also one of the best.

Using these instructions you will be able to create a CD that automatically opens an .htm file containing links to all the rest of the stuff you wish to present on your CD.

I say .htm because using the 8/3 file name format works best.

That is:

Keep the first characters in a file name to 8 characters or less & the last file extension name after the dot to 3 characters.

Example:

MYBIGFILENAME.html

is too big.

13 characters before .html which should be .htm (3 characters)

Proper usage is:

FILENAME.HTM

8 characters before the dot & 3 characters after the dot with NO spaces in the first part of the file name.

This naming of files goes back to MS-DOS.

That is:

3 letters instead 4 letters in the file extension name.

And 8 or less characters in the first part of the file name.

The first 8 characters cannot use a space in the file name to the best of my knowledge.

Example:

My File.htm (wrong usage)

Needed is:

MyFile.htm (right usage)

The way to get a CD to autostart an HTML file instead of an .EXE file depends on this way of writing said html files by using .htm instead of .html to the best of my knowledge.

With the shellexe.exe file you will not get an MS-DOS window that opens first & then disappears after a minute amount of time.

It opens your .htm or other files cleanly & quickly.

Now we come to the issue of the CD ROOT DIRECTORY.

This confused me for a long time.

After a few months study I finally determined that the "root directory" of a CD is simply the area on the CD where you add the .inf & .exe & .htm file & its' supporting _files folder & other stuff.

Think of a root directory this way:

It is a "Folder".

Or directory or subdirectory in your webshell on your webpage server.

If you want a JAVA applet to work on your webpage or a Flash movie, you add the JAVA class or jar files & the .swf file to the same directory as the html object file that calls it up using the local file name instead of an http address.

That is:

The file name itself without an http extension.

If you put a java applet or Flash .swf on a page in a different directory you need to use the http address in the object code to make it work.

Better to keep it all in the same directory.

Burn all the needed autostart files to your CD starting with the .inf file then the .exe file I will provide soon on this page, then the .htm & _files folder & other stuff.

THIS is your "root directory".

I tried all this before even starting this tutorial.

When you stick your CD into your computer & choose "Explore" you will see all the files on it.

What you are looking at is your CD "root directory".

It took me months to understand this because I am not trained in code writing & the tutorials I found explained things poorly.

Sometimes, experts fail to realize that their way of explaining things isn't suited to people with no experience at using computers or writing codes.

I added the codes in what seemed to be a logical sequence to me.

First the autorun.inf file.

Copy the example below & open Notepad & paste it in:

Save as autorun.inf in My Documents to begin with.

You can edit it & change the contents later.

You can drag & drop it or otherwise copy it later to the CD files folder you should create to hold all the files you want to burn to your CD.

You really should put all the files to be burned to your CD in one folder.

See Creating A New Folder Screenshot

There is more stuff you can add to the basic autorun.inf file.

Right now I am just providing the basic form.

Use Google Search & research the more advanced things you can add.

See Notepad Screenshot 1

See Notepad Screenshot 2

See Notepad Screenshot 3

The shellexe.exe file name is added to the autorun.inf file.

Change HTMLTEST.htm to your file name.

Change the TRtest.ico to your icon file name.

An icon can be a .bmp file instead of an .ico file.

Choose a tiny picture. (32 X 32 is a good size to use)

Use Google Search & do some research on icons for better information.

There are freeware programs that will convert .bmp to .ico available also.

Find Some Freeware Icon Making Programs Here

IrfanView can "Save As" .ico.

IconEdit32 is easy to use.

Put an icon image in your "root directory".

[autorun] open=shellexe.exe HTMLTEST.htm icon=TRtest.ico

Example of icon:

icon=TRtest.bmp

It could be:

[autorun] open=shellexe.exe HTMLTEST.htm icon=TRtest.bmp


Download the shellexe.exe file here in ZIP format since Angelfire forbids downloading .exe files:

shellexe.zip

I found shellexe.exe HERE as an .exe file for download.

Go ahead & download the .exe file to save the bother of unzipping my copy if the link still works.

I provided my .zip file as a backup in case the .exe download location disappeared.


After unzipping it:

Add the shellexe.exe file name to the .inf file so it is accessed from your .inf file.

[autorun] open=shellexe.exe HTMLTEST.htm icon=TRtest.bmp

So why don't you start with a fancy Shockwave file?

In the case the user does not have the Flash player, you switch to a PDF file, if the user doesn't have Acrobat Reader, you switch to an HTML file, and if the user doesn't even have a Web browser installed, switch to a plain TXT file.

To accomplish that, the code required in autorun.inf is as simple as this:

open=shellexe.exe intro.swf intro.pdf intro.htm intro.txt

An example of your files to be burned to CD can be seen here:

Files To Be Burned To Your CD Screenshot

As you can see in the screenshot the added files are not displayed in the order I added them to my CD.

Maybe the order displayed in the screenshot is the correct order.

My CD autostarted just fine by my adding the files in the order that I added them.

I added the autorun.inf first.

The shellexe.exe next.

The TRtest.ico next.

The HTMLTEST.htm next.

The HTMLTEST_files folder last.

I figure, if it ain't broke, don't fix it.

To get ANY CD to autostart with XP Pro:

Run regedit in RUN from the start menu:

(Click on Start-click on "Run" - type in: regedit -click on OK)
Under:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

Change the hex value to 95 to ensure that ANY CDs will autostart.

You will need to restart your computer for this new option to take effect.

See Screenshot

See Screenshot

This may or may not work with earlier versions of Windows.

Important Note:

When sticking a CD into your computer first close all open windows and shut down any running programs for best results.

My test CD has hyperlinks on it in the .htm file.

I was not connected to the internet when I tried the CD.

My computer opened my internet connection automatically.

See my tutorial on creating self-contained html documents HERE


NEW - Added: April 16, 2005

I created a folder called TEST in My Documents.
I added the autorun.inf to it.
I added shellexe.exe to it.
I created a folder in TEST called "usage" & added it.
In usage I put several files.
Some .ico files,a test .htm file, & some other file types.

I wrote the autorun.inf thusly:

[autorun] open=shellexe.exe usage\TEST.htm icon=usage\miscA27.ico

Notice the back slash.
This is needed in the autorun.inf.

In the TEST.htm no slash is needed:

<html> <body> <img src="plant3.ico"> </body> </html>

The TEST.htm is in the usage folder with the other files it will access.

Now everything is ready.
I opened the TEST folder.
I saw my three items:

autorun.inf
shellexe.exe
usage folder

I clicked on Edit in the Toolbar & chose Select All.
I clicked on File & chose Send To my CD burning drive E.

Since I have the Address bar shown in the Folder view I clicked on the down arrow & clicked on my CD drive.
In the window it listed the three items ready to be burned to CD.

I clicked on Edit in the Toolbar & chose Select All.
I clicked on File & chose Write these files to CD.

I did so.

After they were burned I inserted the CD & everything worked fine.

The .htm file automatically opened & displayed the image like it was supposed to.

I messed up at first by using "usage\my image" in the .htm file which didn't work.
Instead of using another CD I tried the option to replace the existing files with new ones on the same CD.
It worked.
The ones already there were replaced even though it was a CDR & not a CDRW.
Why that worked I do not know.

NEW - Added April 30, 2005:

NEW TUTORIAL WITH PICTURES - CLICK HERE

My Index Page

Free Website Counter
Web Counters