user3759155
user3759155

Reputation: 21

"Open with" Chrome in the Command-Line

I want to open a html-file in Chrome by using the command-line without setting Google Chrome as default-browser. How can I do this, when I don't know the path where Chrome is installed?

I'm in the folder where the file is lying:

 start page.html

Does there any "open with" Chrome function exist?

I need a solution, where I don't have to navigate to the path where chrome is lying.

Thanks!

Upvotes: 0

Views: 2604

Answers (2)

BarathVutukuri
BarathVutukuri

Reputation: 1303

This command will work.

For Google Chrome:

start chrome page.html

For Firefox

start firefox page.html

But start iexplore page.html will not work.

Upvotes: 1

ATG
ATG

Reputation: 1707

If you don't know the absolute path to the Chrome executable then you're reliant upon it being on the $PATH environment variable (or %PATH% on Windows). If Chrome has been installed normally, then it's probably on the path anyway.

You can try running chrome page.html on the command line. If the Chrome executable is on the path then this will open successfully and try to open page.html in a tab.

If the executable is not on the path then you will need to know the absolute path to it and run something like this instead: /absolute/path/to/chrome page.html or C:\Path\To\Chrome\chrome.exe page.html on Windows.

Upvotes: 0

Related Questions