Solved

launching a ural in multiple web browsers simultaneously

Posted on 2014-02-19
1
198 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
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now