Solved

Batch File

Posted on 1998-08-27
7
385 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

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

Suggested Solutions

Title # Comments Views Activity
8 partitions?!  Really? 8 124
Communication with an active RFID 7 63
RAID 1 - Problem with Data 8 60
intell dp67bg - not detecting all of the memory in bios 4 39
Is it worth it to buy an Echo? In a word, yes! For me it was definitely worth it. I use mine on a daily basis. Prologue & Privacy At first, I was very skeptical about the Amazon Echo. In general, I don't like voice assistants. I don't li…
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

912 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

24 Experts available now in Live!

Get 1:1 Help Now