Solved

Batch File

Posted on 1998-08-27
7
389 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sky and freeview box 3 52
Seatools For Dos (Just shows FreeDos) 21 77
Dell Latitude 6 Series 5 47
CPU speed comparison help needed 2 47
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
A clone is a duplicate copy. Sheep have been cloned and maybe someday even people will be cloned, but disk cloning (performed by the hard drive cloning software) is a vital tool used to manage and protect data. Let’s look at what hard drive cloning …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

679 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