Open a URL in Firefox via PowerShell?
Asked Answered
B

3

7

I want the url to be opened in Firefox by Powershell script

To make things a bit difficult, Firefox is not the default browser and it is a portable Firefox version.

Edit:

There seems to be some problem with my portable firefox installation. Even when making it the default browser, it doesn't work properly when invoked by start url.

I rechecked it with a fresh install of portable Firefox 4.0 from here and ittlefoot's solution works fine.

Burble answered 25/4, 2011 at 8:26 Comment(0)
D
8

Using the website as the first argument should work.

X:\path-to-firefox\firefox.exe "http://website-to-launch.com/yadda"
Dextran answered 25/4, 2011 at 8:28 Comment(2)
I guess it will work for regular Firefox installations, but I have a portable version. it opens a new instance and shoes an error: XML-Verarbeitungsfehler: Nicht definierte Entität Adresse: chrome://coralietab/content/ietabSetting1.xul Zeile Nr. 53, Spalte 11:Burble
Some distributors of portable applications "wrap" the application with an executable launcher, which may not pass along arguments as you're intending. For example, in the PortableApps version of Firefox, there exists in the top-most directory FirefoxPortable.exe, but if you look in the "App\Firefox" directory, there is the actual program that you're looking to run. This should behave as I've described.Dextran
M
6

try

[system.Diagnostics.Process]::Start("firefox","your-url")

not sure it'll work on portable version you might have to (replace "firefox" with the path to the portable exe) however, it works even if firefox is not default.

Misadvise answered 26/1, 2017 at 2:24 Comment(0)
Y
0
Start-Process 'C:\Program Files\Mozilla Firefox\firefox.exe' -argumentlist "-url https://stackoverflow.com"
Yogh answered 7/12, 2021 at 0:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.