Reputation: 101
I am trying to produce a .bat file which will start up two Firefox browsers with multiple tabs and some other programs. Using the following will only open the first Firefox browser with the specified tabs, but not open the second (all the applications open without issue). This is what I have at this stage (there is a prompt bit to avoid accidental running):
@echo off
setlocal
:PROMPT
SET /P AREYOUSURE=Are you sure (Y/[N])?
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END
start "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" www.site1.com/ site2.com/ www.site3.com/sitepage/
start "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" site4.com site5.com
start "" "C:\Program Files (x86)\PATH TO EXE"
start "" "C:\Program Files\PATH TO EXE"
start "" "C:\Program Files\PATH TO EXE"
start "" "C:\Program Files\PATH TO EXE"
:END
endlocal
The Firefox portion was constructed based on information found on this question
Upvotes: 0
Views: 3219
Reputation: 101
I did the same. I removed the prompt and put a shortcut of the .bat in the startup folder(windows).
@echo off
Set URLs='www.mail.google.com www.wunderground.com www.xkcd.com'
Set NewWindow=-new-window
For %%a in (%URLs%) Do (Start /d "%programfiles(x86)%\Mozilla Firefox" Firefox.exe "%%a")
Start /d "%programfiles(x86)%\Mozilla Firefox" Firefox.exe %NewWindow%
exit
Explanation
/d
to pass the path of the .exe%programfiles(x86)%
the (x86)
is needed if you are running windows64. Otherwise remove-new-tab
parameter actually made new windows of each.Hope this helps
EDIT: Possibly try putting your URLs in quotes. "url1 url2 url3" That may solve your problem.
Upvotes: 1