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" [url]www.google.com[/url]

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

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" w[I][/I]w[I][/I]w.google.c[I][/I]om will cause IE to start.

Yeah, I know, that is the weirdest thing...
I bet you thought I typoed it, but, I didn't... LOL..

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.