Opening Chrome From Command Line
Asked Answered
H

10

79

I have the following batch file:

@echo off
REM Starts a chrome browser with multiple tabbed sites
C:\Users\UserName\AppData\Local\Google\Chrome\Application\chrome.exe "site1.com" "site2.com"

But when I run it, it causes the prompt to hang and renders it unusable until Chrome is closed. (Or, if I am not using the prompt and run it from the icon, it opens a blank prompt that is unusable and disappears when Chrome is closed.)

Is there any way to prevent this? I.E. once the webpages are open, the prompt is no longer tied up.

It opens the webpages just fine. I've also noticed that if there's already a chrome window open, the batch runs fine (leaving a usable prompt), adding the tabs to the existing chrome session.

Headstock answered 15/1, 2013 at 23:27 Comment(1)
This will work: google-chrome google.comJuliannejuliano
H
168

Have a look into the start command. It should do what you're trying to achieve.

Also, you might be able to leave out path to chrome. The following works on Windows 7:

start chrome "site1.com" "site2.com"

Haag answered 15/1, 2013 at 23:30 Comment(4)
how can you provide parameters like: google-chrome --enable-webgl --ignore-gpu-blacklistLanner
Include any extra arguments before the URLs. start chrome --enable-webgl --ignore-gpu-blacklist "site1.com" "site2.com"Haag
how to open with a user profile? I have multiple chrome user profiles. @HaagDavinadavine
how can i start chrome with ubuntu?Mahogany
P
9

Use the start command as follows.

start "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://www.google.com

It will be better to close chrome instances before you open a new one. You can do that as follows:

taskkill /IM chrome.exe
start "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://www.google.com

That'll work for you.

Pickax answered 4/10, 2013 at 20:54 Comment(4)
@Vidz use start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://www.google.comEstevan
@Vidz Thanks. I have the same problem. But my dafault browser is IE (internet explorer).Selima
how would you specify a port number?Efik
@NilsSens - you can specify the port number like start chrome "http:localhost:88\bar" Where 88 is the port number. The colon is needed between the domain and the port.Erastatus
G
8

C:\>start chrome "http://site1.com" works on Windows Vista.

Grevera answered 22/2, 2014 at 15:35 Comment(1)
What does that add to the accepted answer, given one year earlier?Chamorro
T
8

Let's take a look at the start command.

Open Windows command prompt

To open a new Chrome window (blank), type the following:

start chrome --new-window 

or

start chrome

To open a URL in Chrome, type the following:

start chrome --new-window "http://www.iot.qa/2018/02/narrowband-iot.html"

To open a URL in Chrome in incognito mode, type the following:

start chrome --new-window --incognito "http://www.iot.qa/2018/02/narrowband-iot.html"

or

start chrome --incognito "http://www.iot.qa/2018/02/narrowband-iot.html"
Thirzi answered 27/2, 2018 at 12:48 Comment(0)
M
5

you can create batch file and insert into it the bellow line:

cmd /k start chrome "http://yourWebSite.com

after that you do just double click on this batch file.

Mineraloid answered 23/11, 2016 at 8:52 Comment(0)
C
3

open command prompt and type

cd\ (enter)

then type

start chrome "www.google.com"(any website you require)
Concatenate answered 5/11, 2013 at 17:38 Comment(0)
C
2

start chrome

Just Type start chrome in your windows terminal.

Cervical answered 7/9, 2022 at 3:9 Comment(0)
E
1

Answering this for Ubuntu users for reference.

Run command google-chrome "http://localhost/"

Replace your desired URL in the parameter.

You can get more options like incognito mode etc. Run google-chrome --help to see the options.

Enterectomy answered 18/11, 2020 at 7:3 Comment(0)
S
0

if you want to open incognito window, put the command below:

start chrome /incognito

Sicyon answered 7/11, 2020 at 12:37 Comment(0)
M
0
Windows:type on Command Prompt and hit enter. 
start chrome (chrome)
start firefox (firefox) 
Ubuntu:type on terminal and hit enter.
google-chrome (chrome)
firefox (firefox) 

if you want to open with path you have to added relative path with command(google-chrome www.facebook.com)
Mahogany answered 7/9, 2022 at 3:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.