help with .bat file opening multiple programs

Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2007
Posts: 86
Reputation: sagedavis is an unknown quantity at this point 
Solved Threads: 6
sagedavis sagedavis is offline Offline
Junior Poster in Training

help with .bat file opening multiple programs

 
0
  #1
Feb 17th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,953
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: help with .bat file opening multiple programs

 
0
  #2
Feb 28th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 86
Reputation: sagedavis is an unknown quantity at this point 
Solved Threads: 6
sagedavis sagedavis is offline Offline
Junior Poster in Training

Re: help with .bat file opening multiple programs

 
0
  #3
Feb 28th, 2008
Yeah, I know, that is the weirdest thing...
I bet you thought I typoed it, but, I didn't... LOL..
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,953
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: help with .bat file opening multiple programs

 
0
  #4
Feb 29th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 36
Reputation: mittelgeek is an unknown quantity at this point 
Solved Threads: 0
mittelgeek's Avatar
mittelgeek mittelgeek is offline Offline
Light Poster

Re: help with .bat file opening multiple programs

 
0
  #5
Sep 3rd, 2008
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC