[thelist] cd autorun

Lee Stewart LeeStewart at bigfoot.com
Mon Apr 16 23:06:51 CDT 2001


> This is targeted to "ONLY" Windows 9x machines.
> Also these people have never even heard of Netscape. So IE is the only
> browser that I am concerned with.

I built a website with family photos and put it on a CD to share with
everyone.  I created an autorun for it - it's pretty easy to do and the code
is cross-browser.

1) In the root of the CD, make a file called autorun.inf, which contains:

   [autorun]
   ICON=Launcher.exe
   open=Launcher.exe your_html_file.html


2) Copy a Launcher.exe file to the root.  I wrote one using C:

  #include "stdafx.h"
  int APIENTRY WinMain(HINSTANCE hInstance,
                       HINSTANCE hPrevInstance,
                       LPSTR     lpCmdLine,
                       int       nCmdShow)
  {
    char    szCurrentDir[1024];

    GetCurrentDirectory(1024, szCurrentDir);
    ShellExecute(NULL, "open", lpCmdLine, NULL,
                 szCurrentDir, SW_SHOWNORMAL);
    return 0;
  }


I'd recommend compiling your own version of this program - you can attach
whatever icon you want to show up.  I can send you a compiled version of the
program with a camera icon if you contact me off-list (you must promise to
only use this for good, never for evil).


This technique will work for every browser - basically it's asking Windows
to open the HTML document with the default program (actually, Launcher will
work with any file type).  The only problem is that some people have autorun
disabled and they'll need to have instructions on finding the CD and
double-clicking "your_html_file.html".




--- --- --- --- --- --- --- --- --- --- --- --- ---
Lee Stewart       StripedCow Technology Group, Inc.
                           advanced web development





More information about the thelist mailing list