Solved

Batch File

Posted on 1998-08-27
7
383 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
  • 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Upper back Pain: My back hurt for months. Upper back, mostly my neck, spine and across my shoulder blades. I was getting headaches too, that felt like they were caused by tension in my shoulders, but now I feel fine! I'm sharing this hoping someone…
The Rasberry PI is a low cost piece of hardware that you can have a lot of fun with through experimenting and building/working on projects like media players, running a low cost computer, build data loggers etc. - see: https://www.raspberrypi.org
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

18 Experts available now in Live!

Get 1:1 Help Now