Solved

Autorun html file

Posted on 2002-06-21
13
232 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
 
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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Fine Tune your automatic Updates for Ubuntu / Debian
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now