Solved

Autorun html file

Posted on 2002-06-21
13
222 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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

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 Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

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…
We have come a long way with backup and data protection — from backing up to floppies, external drives, CDs, Blu-ray, flash drives, SSD drives, and now to the cloud.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

758 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

19 Experts available now in Live!

Get 1:1 Help Now