# Calling IE from a batch file

**URL:** <https://boards.straightdope.com/t/calling-ie-from-a-batch-file/250492>\
**Category:** Factual Questions\
**Created:** [June 15, 2004, 4:20pm UTC](https://boards.straightdope.com/t/calling-ie-from-a-batch-file/250492 "2004-06-15T16:20:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![erislover](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@erislover](https://boards.straightdope.com/u/erislover)\
**Post date:** [June 15, 2004, 4:20pm UTC](https://boards.straightdope.com/t/calling-ie-from-a-batch-file/250492/1 "2004-06-15T16:20:24Z")

</div>

At home, I use Opera, and I’ve configured it to allow me to do fun stuff, like type “mw laconic” to launch “[http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va=laconic](http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va=laconic)”, or “ljf erislover” to go to my livejournal’s friends page. Fun.

I’m trying to emulate that behavior here at work where I use IE by making a batch file that accepts parameters. So I have “mw.bat” and “ljf.bat”. If I have no IE windows open, it works fine. If I _do_ have windows open, though, it hijacks those to go to the page I want.

Is there any way to guarantee it will always open in a new page, and not leave a dangling command prompt window?

---

<div class="post-metadata">

**Author:** ![Q.E.D](https://avatars.discourse-cdn.com/v4/letter/q/51bf81/32.png) [@Q.E.D](https://boards.straightdope.com/u/Q.E.D)\
**Post date:** [June 15, 2004, 4:42pm UTC](https://boards.straightdope.com/t/calling-ie-from-a-batch-file/250492/2 "2004-06-15T16:42:00Z")

</div>

Add the “-new” switch (sans quotes) to the end ot the command line. This will force IE to open a new window to launch the URL.

---

<div class="post-metadata">

**Author:** ![erislover](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@erislover](https://boards.straightdope.com/u/erislover)\
**Post date:** [June 15, 2004, 4:52pm UTC](https://boards.straightdope.com/t/calling-ie-from-a-batch-file/250492/3 "2004-06-15T16:52:50Z")

</div>

I can’t seem to find a permutation that works with a new switch. Here’s the file’s one line:

```auto

start "F:\Program Files\Internet Explorer\iexplore.exe" "http://www.livejournal.com/users/%1/friends/"

```

I can’t get the new switch to work without it also thinking it is part of the URL…

---

<div class="post-metadata">

**Author:** ![Q.E.D](https://avatars.discourse-cdn.com/v4/letter/q/51bf81/32.png) [@Q.E.D](https://boards.straightdope.com/u/Q.E.D)\
**Post date:** [June 15, 2004, 5:40pm UTC](https://boards.straightdope.com/t/calling-ie-from-a-batch-file/250492/4 "2004-06-15T17:40:36Z")

</div>

Ah, I see what you’re doing. Do this:

```auto

start "F:\Program Files\Internet Explorer\iexplore.exe -new" "http://www.livejournal.com/users/%1/friends/"

```

I just tried it with a different URL, to test it, and it does work.

---

<div class="post-metadata">

**Author:** ![larsenmtl](https://avatars.discourse-cdn.com/v4/letter/l/d78d45/32.png) [@larsenmtl](https://boards.straightdope.com/u/larsenmtl)\
**Post date:** [June 15, 2004, 5:40pm UTC](https://boards.straightdope.com/t/calling-ie-from-a-batch-file/250492/5 "2004-06-15T17:40:47Z")

</div>

```auto

"c:\Program Files\Internet Explorer\iexplore.exe" -new http://www.livejournal.com/users/%1/friends/

```

I think you can also change in IE --\> Tools | Internet Options | Advanced | Uncheck “Reuse Windows for Launching Shortcuts”

---

<div class="post-metadata">

**Author:** ![erislover](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@erislover](https://boards.straightdope.com/u/erislover)\
**Post date:** [June 15, 2004, 5:57pm UTC](https://boards.straightdope.com/t/calling-ie-from-a-batch-file/250492/6 "2004-06-15T17:57:20Z")

</div>

Great! Got it. Thanks guys.
