Build an executable file for autorun.inf

How do I build an executable file to open an .html file to be placed on a CD?

I think it can be done with Visual Basic and I understand autorun.inf must point to an .exe
MommaCrabAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mark2150Commented:
You'll have a *tiny* VB program that performs a ShellExecute command to fire the default web browser and the param to the ShellExecute will be the name of the web page.

M
0
nutwissCommented:
Personally I would do it in Delphi (or at least C++) because it may be a chore to guarantee that the user has a full copy of the necessary VB run-time files to execute a VB app...

however, this simple sub should do the job (assuming the EXE and the .htm file are in the root folder):

Put this in a Module (.Bas file) remove ALL forms from the project.

'##############################

Option Explicit
Private Const SW_SHOWMAXIMIZED = 3
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub Main()
ShellExecute 0, vbNullString, App.Path & "\Default.htm", "", App.Path, SW_SHOWMAXIMIZED
End Sub

'##############################

if you compile this specifying 'Unattended execution' this will compile to < 8Kb

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KDivadCommented:
Echo?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.