50

The default behavior of running chrome via the command-line:

chrome www.google.com

opens a new tab in an existing instance of chrome and moves the focus from the terminal to the newly created tab.

Adding the new-window switch:

chrome --new-window www.google.com

opens chrome in a new window but does not move the focus.

What options should I use to open a new window but also switch focus to that window?

Note: I'm using Windows 7.

Isaac Kleinman
  • 679
  • 1
  • 6
  • 10
  • I'm using Windows 7 – Isaac Kleinman Mar 20 '14 at 16:33
  • 1
    I'm using Windows 7 too, and it works for me... When I launch Chrome from a command-line with --new-window command it opens the address in a Chrome new window, and takes focus. How exactly are you launching the command? – Ƭᴇcʜιᴇ007 Mar 20 '14 at 16:36
  • Exactly as I described in the question. – Isaac Kleinman Mar 20 '14 at 16:39
  • if you're using a standard Windows Command Prompt (assuming that's what you mean by 'the terminal') and just running it from there as stated, then it should take focus (does for me anyway). What version if Chrome are you using? I'm on 33.0.1750.154 m. – Ƭᴇcʜιᴇ007 Mar 20 '14 at 16:42
  • Strange. I'm using the standard Windows Command Prompt; same chrome version. – Isaac Kleinman Mar 20 '14 at 16:44
  • Have you tried it in Safe Mode, or after disabling all 3rd party services and start-ups via MSConfig? You may have something installed that's causing the troubles (like say, a virtual desktop manager like Dexpot).. – Ƭᴇcʜιᴇ007 Mar 20 '14 at 16:44
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/13740/discussion-between-isaac-kleinman-and-techie007) – Isaac Kleinman Mar 20 '14 at 16:55
  • I have not; can you point me to some place on the web with a description of doing this? – Isaac Kleinman Mar 20 '14 at 17:21
  • If I do something like that, I always have to install a waiting time until the page is fully loaded. only then follows every further processing. Maybe that will help you. – SL5net Apr 03 '19 at 20:39
  • How to use same session for both monitors ? Any idea ?. I believe we cant share the same session for both monitors because of security. is that true? , then how to share the same user session for both windows – Senanayaka Jul 29 '20 at 07:59

5 Answers5

49

try this one

start chrome /new-window www.google.com

opens google.com in a new instance of chrome.

Pascal
  • 506
  • 5
  • 3
  • 9
    Awesome. `chromium --new-window` seems to work on Linux. Missing from the manpage. – Jack O'Connor Oct 07 '15 at 21:00
  • 3
    On Windows 10 this *does not* start a new process. – Howard Hoffman Oct 26 '17 at 12:30
  • 1
    @HowardHoffman --new-window doesn't open a new instance/process. In example, you could not apply --proxy-server to that new window. It's just a detached window of the same instance, same profile, etc. – m3nda Jul 24 '18 at 10:26
  • 1
    Doesn't work i Win10, power shell returns "Start-Process: A positional parameter cannot be found that accepts argument 'www.google.com' " – Sergiy Kolodyazhnyy Apr 24 '19 at 15:25
  • 1
    @SergiyKolodyazhnyy add quotes to the call, in this example start chrome "/new-windows www.google.com" this will force that to bind to -argumentList (as one arg, which is fine) – jrich523 May 06 '19 at 19:02
  • --new-window parameter works under Windows 10. I use that parameter along with --proxy-server=xxxxx. Thanks. – MKANET Feb 14 '20 at 16:29
  • start chrome --new-window http://url/#/ --window-position=0,0 --user-data-dir=c:/monitor1 start chrome --new-window http://url/abc/ --window-position=2800,0 --user-data-dir=c:/monitor1 I need to share same session for both monitors and windows any idea???? – Senanayaka Jul 29 '20 at 08:03
3

Try to use this extension which solves this bug: Chrome New Window Focus.

BornToCode
  • 319
  • 1
  • 3
  • 15
1

Give a time and it will focus on active window:

start chrome.exe --new-window "http://hotmail.com"

start chrome.exe --new-window "http://gmail.com"

TIMEOUT 1

start chrome.exe "http://yahoo.com"
shdcol
  • 21
  • 1
  • 1
    Welcome to Super User. Can you explain what exactly happens when you run these commands? In particular, why the 3rd `start` command? Also, it's unclear what you mean by *"Give a time"*. – I say Reinstate Monica Apr 18 '17 at 17:50
0

in 2023, with Chrome version Version 110.0.5481.97 (Build officiel) (64 bits), starting Chrome using START Dos command doesn't work anymore !

The solution that works on my Windows 11 PC

set chrome="C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
start "test" %chrome% --new-window "www.google.com"

or

%chrome% --new-window "www.google.com"

If using START Dos command, first parameter just after start string is imperative !

If I run following commands,

set chrome="C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
start %chrome% --new-window "www.google.com"

Windows return an error message that indicate that it doesn't find "--new-window" !

enter image description here

I use START command to load multiples LOCAL files in Chrome using following BAT script

set chrome="C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
set dirname=%cd%

set url= 
set url=%url% "file:///%dirname%\TABLES.CUMUL.SOLAIRE.html"
set url=%url% "file:///%dirname%\CHARTS.CUMUL.SOLAIRE.html"
set url=%url% "file:///%dirname%\TABLES.CUMUL.JOUR_NUIT.html"
set url=%url% "file:///%dirname%\CHARTS.CUMUL.JOUR_NUIT.html"
set url=%url% "file:///%dirname%\TABLES.CUMUL.JOUR_NUIT_SOLAIRE.html"
set url=%url% "file:///%dirname%\CHARTS.CUMUL.JOUR_NUIT_SOLAIRE.html"
set url=%url% "file:///%dirname%\TABLES.CUMUL.EXCLUSIF.html"
set url=%url% "file:///%dirname%\CHARTS.CUMUL.EXCLUSIF.html"

start "kWh" %chrome% --new-window %url%
schlebe
  • 247
  • 2
  • 14
-1

You can try following command for the same.

start chrome google.com

It will open Google in the new window of the chrome and also gets focused on that webpage.

Ishan Shah
  • 283
  • 1
  • 7