Solved

Autorun html file

Posted on 2002-06-21
13
260 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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…
Read  the original post  on Monitis Blog. Hi.  My name is Erik Dietrich, and this is the first time I’ve posted on the Monitis blog.  By way of introduction, I thought it would make sense to talk about my initial experience with Monitis.   Befo…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

733 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