Link to home
Start Free TrialLog in
Avatar of Winston Smith
Winston SmithFlag for Canada

asked on

create a small exe to open htmlfile

I have a CD with an html file (index.html), it is set to autorun but if it doesn't the user is told to click on play.exe to start the file. This was mistakenly put on the cd cover so now we have to come up with an exe to launch the web page. can i use VB? Any other kind of exe that opens a web page would be fantastic. Any suggestions to get us out of this mess?

Thank You
Avatar of venkateshwarr
venkateshwarr

A small batch file would do...

start.bat
-----------
start index.html
Avatar of Winston Smith

ASKER

i need it to have the erxtension .exe

Is this possible with a batch?
>>>>>i need it to have the erxtension .exe<<<<<

Then it is better to go for VB. You can use Shell iexplore <html file> for opening HTML files.
would i have to include the VB runtimes on the cd? Or would it work as a syandalone exe?
VB runtimes?  You have to include.

Otherwise, the Targetting system must be having VB installed.

Anything will get you the result. Provided the versions of VB same. That is if you developed the program in VB 6 then the target must have VB 6.
if it has to be .exe then convert the batch file described above to an executalbe using bat2exe tool

http://nlsn.free.fr/batch-down/Bat2Exe.ZIP
Avatar of Julian Hansen
Why not just do it in C - no runtimes - here is the code.
#include "stdafx.h"
#include "shellapi.h"

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
  LPSTR szPath = "D:\\test.html" ; // Change as required.

  ShellExecute ( NULL, "open", szPath, NULL, NULL, SW_SHOW ) ;
  return 0;
}
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That worked perfectly julianH!!!! Thank yo for your time and excellent solution to my problem!

Cheers Mate!

No problem - glad to have been of help