Solved

Autorun html file

Posted on 2002-06-21
13
270 Views
Last Modified: 2010-04-13
I have read that this is the most common question so here it one more time.   I would like to autorun a html file on Windows 95, Windows NT and Windows 2000.  I would like to stay away from shelling out to a DOS windows if possible.  we were using the open=start myfile.htm in the autorun and that worked ok on the 95 boxes but on the the 2000 and NT Workstations it gave an error.  How do I make this work on all operating systems?
0
Comment
Question by:curtis591
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +5
13 Comments
 
LVL 28

Expert Comment

by:vinnyd79
ID: 7099173
have you tried using shellexecute api

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
Private Const conSwNormal = 1

Private Sub Command1_Click()
ShellExecute hwnd, "open", "myfile.htm", vbNullString, vbNullString, conSwNormal
End Sub
0
 
LVL 6

Author Comment

by:curtis591
ID: 7099182
No, I take it that I would put this in a Visual Basic Program?  If so am I going to run into the problem of the user not havng the Visual Basic Dll's on their computer or can I do this somehow that uses the dll' everyone has?
0
 
LVL 1

Expert Comment

by:Boomers
ID: 7099184
Hi curtis591,

   Have you tried to write an .exe that would call your HTML. This could be a work around. I made that type of .exe a long time ago but it was only to do user validation before opening a support site.

Good luck!!!
0
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
LVL 6

Author Comment

by:curtis591
ID: 7099205
How do I make an exe where I know the user will have the proper dlls to run?  Most of these computer I think just have the standard Windows 95 install.
0
 

Expert Comment

by:alicelknight
ID: 7099472
curtis591

Try:
shellexecute=[filepath\]filename[param1], [param2]...]

example:
shellexecute=myhtmfile.htm

The shellexecute command specifiles an application or data fiile that AutoRun will use to call ShellExecuteEx.

Parameters
Filepath:  A string that contains the fully-qualified path of the directory that contains the data or executable file.  if no path is specified, the file must be in the drive's root directory.

Filename:  A string that contains the file's name.  If it is an executable file, it is launched.  if it is a data file, it must be a member of a file class.  ShellExecuteEx lauches the default command associated with the file class.

Paramx
Contains any additional parameters that should be passed to ShellExecuteEx.

This command is similar to open, but it allows you to use file association information to run the application.

See:  http://msdn.microsoft.com/library/en-us/shellcc/platform/Shell/programmersguide/shell_basics/
0
 

Expert Comment

by:alicelknight
ID: 7099474
curtis:
sorry, the link is dead.  Do a search on msdn for AutoRun

Alice
0
 

Expert Comment

by:alicelknight
ID: 7099479
Curtis:

fyi:  AutoRun doesn't work on Windows ME like it does other OS's.  It has to be configured for it.  So if you're testing, don't test AutoRun's on a ME OS.

Alice

0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 100 total points
ID: 7099607
Could you try with a vbs file?

dim sh
set sh =CreateObject("WSCript.shell")
sh.run "myfile.htm"


'in autorun.inf file
open=myscript.vbs
0
 
LVL 1

Expert Comment

by:Jedi
ID: 7100937
Is it supposed to run as the machine boots up, or when a user log on to the machine?

If it is when a user logs on, can't you just place an Internet Explorer shortcut to your url in the "startup" folder on "all users" ?

Otherwise I guess that the vbscript file would do the trick.

Good luck
0
 
LVL 10

Expert Comment

by:Longbow
ID: 7103369
iexplore C:\WINNT\system32\readme.htm
?
0
 
LVL 6

Author Comment

by:curtis591
ID: 7109146
From some initial testing it looks like this should work.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7109174
If you need more help just ask...
Thanks for "A" grade.
0
 

Expert Comment

by:tsalfis
ID: 8326309
A had the same problem. You can copy start.exe to the CD and it will work on win2000 an XP. I'm not sure if it works on NT because I can't test NT.
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
The conference as a whole was very interesting, although if one has to make a choice between this one and some others, you may want to check out the others.  This conference is aimed mainly at government agencies.  So it addresses the various compli…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question