Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

launching a ural in multiple web browsers simultaneously

Posted on 2014-02-19
1
Medium Priority
?
206 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 2000 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

Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

721 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