?
Solved

Autorun html file

Posted on 2002-06-21
13
Medium Priority
?
280 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
  • 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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 400 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
I came across an unsolved Outlook issue and here is my solution.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

850 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