Launching 2 Google Chrome windows in different positions

4

3

I am trying to create shortcuts (to eventually add to startup folder) on Windows 7 that will launch Google Chrome as two differently sized window at two different positions, in app mode.

I have two shortcuts:

"C:\Program Files\Google\Chrome\Application\chrome.exe" --app=http://www.example.com --window-size=400,300 --window-position=200,200

and:

"C:\Program Files\Google\Chrome\Application\chrome.exe" --app=http://www.example.com --window-size=400,300 --window-position=600,200

That should launch the first window 400px x 300px, 200px from the left and 200px from the top.

The second window shout launch 400px x 300px, 600px from the left and 200px from the top.

Whichever window I launch first works correctly. If I launch the first shortcut first it launches 200px from the left, if I launch the second first it launches 600px from the top.

However, whichever I launch second launches in the same position as the first.

How can I make these work independently from eachother so whichever I launch does not snap to the position of the first window launched?

kieran

Posted 2015-03-12T15:29:40.933

Reputation: 41

Answers

7

The window args don't seem to be working at all in my environment, but following other examples that use javascript to move the window do. Here's an example (switched "Program Files" for 64bit):

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --app="data:text/html,<html><body><script>window.moveTo(200,200);window.resizeTo(400,300);window.location='http://www.example.com';</script></body></html>"

and the 2nd:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --app="data:text/html,<html><body><script>window.moveTo(600,200);window.resizeTo(400,300);window.location='http://www.example.com';</script></body></html>"

The windowing works, but the taskbar icons are set to generic files instead of chrome.

jdh

Posted 2015-03-12T15:29:40.933

Reputation: 6 645

2

You need to create a session (--user-data-dir) for each window, try this:

start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window "http://brianp.dk/" --window-size="2560,1000" --window-position="0,0" --user-data-dir="D:/Test/Profiles/1"
start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window "http://borsen.dk/" --start-maximized --window-position="2560,000" --user-data-dir="D:/Test/Profiles/2"
start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window "http://penge.dk/" --window-size="1280,1000" --window-position="0000,1000" --user-data-dir="D:/Test/Profiles/3"

Brian P

Posted 2015-03-12T15:29:40.933

Reputation: 21