1

I have found a lot of answers on how to do the exact opposite of what I'm looking to do, but nothing really on what I'm trying to do.

I have an EXE file that I want to use to open an HTML file in the user's browser as soon as it is executed.

I have two files in the EXE - autorun.inf and index.html. The index.html is what I want to open.

In autorun.inf I have:

[autorun]
open=index.html

All this does is open an error box that says "Installation Failed".

Jim Garrison
  • 85,615
  • 20
  • 155
  • 190
ScottD
  • 582
  • 3
  • 9
  • 24

1 Answers1

0

You don't say what language you are writing the .exe in. The easiest thing to do would be to have that program launch the html file. For example, in VB/C# you would add the following inside your main method:

    System.Diagnostics.Process.Start("pathtohtmlfile.html");

No need to do anything in the autorun.inf file.

Scott Marcus
  • 64,069
  • 6
  • 49
  • 71
  • Sorry, I'm using Iexpress.exe to create the .exe, which has an option to launch a .inf when the .exe runs. – ScottD Feb 12 '16 at 20:52
  • I'm not familar with lexpress, but as i said, rather than code the .inf, just use the language to launch the file and the OS will take care of launching the browser to host it. – Scott Marcus Feb 12 '16 at 20:55
  • I'm not familiar with creating an exe manually, I have only used Iexpress, I'll look into it though. Thanks. – ScottD Feb 12 '16 at 21:25