Solved

launching a ural in multiple web browsers simultaneously

Posted on 2014-02-19
1
202 Views
Last Modified: 2014-02-19
Hi experts,

I'm trying to create a batch file that when I double click on it, it opens a url in mulitple web browsers at the same time.

So my batch file is called mytest.bat

This is my code.

set /p url= [https://www.bing.com]

if exist "C:\Program Files\Internet Explorer\iexplore.exe" start "" "C:\Program Files\Internet Explorer\iexplore.exe" %url%&
if exist "C:\Program Files%(x86)\Mozilla%Firefox\firefox.exe" start "" "C:\Program Files%(x86)\Mozilla%Firefox\firefox.exe" %url%&
if exist "%ProgramFiles(x86)%\Opera\opera.exe" start "" "%ProgramFiles(x86)%\Opera\opera.exe" %url%&
if exist "%ProgramFiles(x86)%\Safari\Safari.exe" start "" "%ProgramFiles(x86)%\Safari\Safari.exe" %url%&
if exist "%USERPROFILE%\AppData\Local\Google\Chrome\Application\chrome.exe" start "" "%USERPROFILE%\AppData\Local\Google\Chrome\Application\chrome.exe" %url%&

Open in new window


But something is not correct.

What I'm a doing wrong? or is there a better way to do the same thing?
0
Comment
Question by:maqskywalker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
ChloesDad earned 500 total points
ID: 39871910
You almost had it

set url=www.google.com

if exist "C:\Program Files%(x86)\Mozilla%Firefox\firefox.exe" start "" "C:\Program Files%(x86)\Mozilla%Firefox\firefox.exe " %url%
if exist "%ProgramFiles(x86)%\Opera\opera.exe" start "" "%ProgramFiles(x86)%\Opera\opera.exe " %url%
if exist "%ProgramFiles(x86)%\Safari\Safari.exe" start "" "%ProgramFiles(x86)%\Safari\Safari.exe " %url%
if exist "%USERPROFILE%\AppData\Local\Google\Chrome\Application\chrome.exe" start "" "%USERPROFILE%\AppData\Local\Google\Chrome\Application\chrome.exe " %url%
if exist "C:\Program Files\Internet Explorer\iexplore.exe" start "" "C:\Program Files\Internet Explorer\iexplore.exe " %url%

Open in new window


I added a space at the end of each program, and removed the square brackets from the url. In my testing I didn't need the http:// either. The & at the end of each line is also not required.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

735 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