Solved

Batch File

Posted on 1998-08-27
7
391 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
Stuck in voice control mode on your Amazon Firestick?  Here is how to turn it off!!!
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

734 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