Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open a URL in Firefox via PowerShell?

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.

like image 320
bernd_k Avatar asked Apr 25 '11 08:04

bernd_k


2 Answers

Using the website as the first argument should work.

X:\path-to-firefox\firefox.exe "http://website-to-launch.com/yadda"
like image 199
Max Vu Avatar answered Oct 10 '22 01:10

Max Vu


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.

like image 44
Ademola Adesibikan Avatar answered Oct 10 '22 00:10

Ademola Adesibikan