Solved

Batch File

Posted on 1998-08-27
7
390 Views
Last Modified: 2010-04-26
Hi,

I'm trying to make a batch file that will open an html file on command.
I want Internet explorer to open the html page.

Right now my batch file looks something like this.

C:\IE\IExplorer.exe %1

But the thing is,
I have to include the path in which the html resides and the filename as part of the
parameter.
Is there a way to just supply the filename and get the current directory
programmicly and then just cancatenate the two together?

Thanks
0
Comment
Question by:BabyFace
[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
7 Comments
 
LVL 10

Expert Comment

by:MasseyM
ID: 1010068
Running the batch in dos?  If in Win95/98, just click run and type in file://path/filename.htm  It will do IE for you...

0
 
LVL 1

Author Comment

by:BabyFace
ID: 1010069
It's a Dos batch file.
0
 
LVL 1

Accepted Solution

by:
bequette earned 30 total points
ID: 1010070
In Dos the current directory is denoted with the . parameter.  you should change your line to
C:\IE\IExplorer.exe .\%1
this will run the link if you type your batch file name in the directory that the html file is in.  Of course your batch file will need to reside in a directory that is in the path.
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 1

Author Comment

by:BabyFace
ID: 1010071
Thanks alot
0
 
LVL 1

Author Comment

by:BabyFace
ID: 1010072
Hey,

Wait,

I tried that batch command but it didn't work!
0
 
LVL 1

Expert Comment

by:bequette
ID: 1010073
Is your Internet Explorer starting, or are you getting a message like Invalid command, or the command was niot recognized?  If the Internet explorer program is not starting, your batch file is probably not in the path.  If your in Windows95, or standard windows, put the file in your windows directory.  If your are using Windows NT 3.51 place the file in your C:\WINNT35\System32 directory.  If your are using Windows NT 4.0, place the file in C:\WINNT\System32.  Or you can create your own directory and add it to the path.  If IE is starting, your batch file is actually found, but there can be one of two problems.  The . commands denotes the current directory, not a path search, so if the file you are trying to load is not in the directory that you type in the batch command, the file won't be found.  Another problem may be the way internet explorer loads files or links.  I personally use Netscape, but I'm sure IE should be able to load files from command line.  There may be an extra thing like IE -f <Filename>.  Try  IExplorer -? or IExplorer /? as some MS software allows this option, or search IE Help for words like command line parameters.  Please contact EE to reopen the question and surrender my points, as my solution didn't work.  Do keep in mind though, the . parameter does mean the current directory, so if the problem wasn't path of the batch file, you will still find that the . is the solution, but with the added command line parameter.  If I get a chance to get on a machine with IE I will get you the parameter as well.
0
 
LVL 1

Expert Comment

by:bequette
ID: 1010074
Actually, I just tried the above on a computer at work with IE and windows NT 4.0 And it works.  The only differance is the directory that IE is installed in "C:\Program Files\Plus!\Microsoft Internet\IExplore.exe"
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Determine exact dimensions of screen 5 88
RAM PROBLEM 5 77
disable USB on Dell Printers 14 79
When to add more RAM / Memory 19 69
Does your iMac really need a hardware upgrade? Will upgrading RAM speed-up your computer? If yes, then how can you proceed? Upgrading RAM in your iMac is not as simple as it may seem. This article will help you in getting and installing right RA…
Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.

737 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