943,617 Members | Top Members by Rank

Ad:
Feb 17th, 2008
0

help with .bat file opening multiple programs

Expand Post »
Hi all,
as a web developer, I am working on cross browser usage. I know, I know, there are websites that take snap shots.

The issue is a bit more indepth. I've got stuff that LOOKS alright in most browsers but don't exactly function properly (some javascript stuff, some dom uasage).

I have (on the same computer) firefox, safari, opera, ie7, ie6, ie5.
I want to test in all of these browsers.
At windows command line, it's fairly easy to launch a url in each of these.
"C:\Program Files\Mozilla Firefox\firefox.exe" www.google.com

So, I figured, "why not make a bat file that opens the site up in each of these browsers". It should be easy enough right?
"C:\Program Files\MultipleIEs\IE6\IEXPLORE.exe" www.google.com
"C:\Program Files\MultipleIEs\IE55\IEXPLORE.exe" www.google.com
"C:\Program Files\Mozilla Firefox\firefox.exe" www.google.com
and save as .bat and open the bat file.

Well, what is happening is that it does open them, but not all at once, not even one right after the other. I have to close the first one, then the second one pops up, then close that and the third one pops up.

I have tried prefixing these with "start". which (for some weird reason), only serves to open all three of these in IE7 (my default browser).

Eventually, I would prefer to build a small VB program that will open them all in a tab style format, unfortunately, I don't think that's possible given that vb 2005 only has one browser type to use.

At any rate, if anyone can tell me why there is this pause happening and how to get around it, that would be great.
Thanks
Sage
Last edited by sagedavis; Feb 17th, 2008 at 6:24 pm. Reason: typo
Reputation Points: 10
Solved Threads: 6
Junior Poster in Training
sagedavis is offline Offline
86 posts
since Nov 2007
Feb 28th, 2008
0

Re: help with .bat file opening multiple programs

As no one has responded yet...

Batch files wait for each command to finish before continuing on to the next.

I am, however, surprised that
start "C:\Program Files\Mozilla Firefox\firefox.exe" www.google.com
will cause IE to start.
Featured Poster
Reputation Points: 1140
Solved Threads: 229
Postaholic
Duoas is offline Offline
2,039 posts
since Oct 2007
Feb 28th, 2008
0

Re: help with .bat file opening multiple programs

Yeah, I know, that is the weirdest thing...
I bet you thought I typoed it, but, I didn't... LOL..
Reputation Points: 10
Solved Threads: 6
Junior Poster in Training
sagedavis is offline Offline
86 posts
since Nov 2007
Feb 29th, 2008
0

Re: help with .bat file opening multiple programs

If you are willing to play with the Windows Shell, you could probably get it to do what you want.

Something like this (starturl.vbs):
' Make sure that the URL to display is specified. Complain if not.
If WScript.Arguments.Count < 1 Then
  WScript.Echo "You must call the script with the name of the web page to display"
  WScript.Quit
End If

' Double quote the URL if it has spaces in it.
' (This is too stupid here to notice if the URL has double quotes in it already.)
url = WScript.Arguments.Item( 0 )
If InStr( url, " " ) Then
  url = """" & url & """"
End If

' Create the shell and start each browser to display the URL
Set Shell = CreateObject( "WScript.Shell" )
Shell.Run( """C:\Program Files\MultipleIEs\IE6\IEXPLORE.exe"" " & url, , False )
Shell.Run( """C:\Program Files\MultipleIEs\IE55\IEXPLORE.exe"" " & url, , False )
Shell.Run( """C:\Program Files\Mozilla Firefox\mozilla.exe"" " & url, , False )

Hope this helps.
Last edited by Duoas; Feb 29th, 2008 at 12:20 am.
Featured Poster
Reputation Points: 1140
Solved Threads: 229
Postaholic
Duoas is offline Offline
2,039 posts
since Oct 2007
Sep 3rd, 2008
0

Re: help with .bat file opening multiple programs

In order to get what you want to happen try this [all one line]:
start firefox www.google.com & start "C:\Program Files\MultipleIEs\IE6\IEXPLORE.exe" www.google.com & start "C:\Program Files\MultipleIEs\IE55\IEXPLORE.exe" www.google.com
The & is used to start more than one process using the same command line. Using && will allow you to start additional processes only if the previous process started without issue.
Reputation Points: 10
Solved Threads: 0
Light Poster
mittelgeek is offline Offline
37 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Legacy and Other Languages Forum Timeline: Need to send Cntrl +C to an Running Exe using a DOS batch File.
Next Thread in Legacy and Other Languages Forum Timeline: How to get "NIGHT" node from LISP list (((GOOD))((NIGHT))) ?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC