We are developing a web application that needs to open in two different browser instances each on a different Screen. Obviously the pc we are using has dual display already, and both monitors have the same size and resolution.
The idea is that as soon as Windows starts the two applications should open immediately in fullscreen, our preferred browser is Chrome as it counts with several commands that might help us accomplish the task.
We have succeeded on adding to the startup programs two shortcuts that open two instances in kiosk mode, but we have not been able to choose on which Display to open.
The shortcuts have this target:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=c:\temp --kiosk www.domain.com --new-window "%1" --window-position=0,0
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=c:\temp --kiosk www.domain2.com --new-window "%2" --window-position=1680,0
In order to open two instances chromes needs to create a temporary file with information of the instance to open (--user-data-dir=c:\temp)
We tried using (--window-position=1680,0
) to specify where to open the instance but it seems that Chrome will give priority to the last position where the last instance was opened, so both instances open on the same window regardless of the command.
We found this site with a list of all the commands available but the list is huge and we don't even know what we are looking for:
http://peter.sh/experiments/chromium-command-line-switches/
I found this command: --display=:0.0 | --display=:0.1
But it doesn't seem to work or I am not using it properly
Any ideas? Thanks.
The easiest way to accomplish this is to use 2 different data directories. You may or may not want to delete the preferences before launching. If you do, your script can control where screens are placed. If you don't, then they can be manually positioned and it will remember the position of both windows separately:
Note, I also used --start-fullscreen instead of kiosk, and --new-window. You may or may not need those.
I run in the same problem and got setup a good solution with the command line flags. The solution from https://stackoverflow.com/a/29646543/3634274 works also very well, but it needs some setup every time when i want to install new multimonitor stations and i have no named icons for each application.
I use a combination of some command line flags and it works:
Monitor 1:
Monitor 2:
It is important to use completly seperated user profiles, because when you have your Chrome with your profile open then it don't starts as it's own instance. With that setup i can use my chrome as it is and open my apps on the second or third monitor, e.g. like monitoring apps on which i only want to display stuff.
To make it easy for setup i wrote a powershell script that creates only the shortcut with a icon:
I hope this solution helps all that searches for a similar solution.
Last but not least what does this script?
I have the same issue also. This answer: https://stackoverflow.com/a/3750187/1305565 inspired me to create own PowerShell script for easier use.
Shortly
Script does the following:
Final script
Function definitions are hidden in Dll and in another helper script. (download them from GitHub using the link above)
I'm having a very hard time finding an answer myself.
The closest-to-easy solution, since you're running Windows, that I could find was to create a batch file +VBScript that will emulate the Win+Arrow-keys shortcut to move a window to the 2nd display. Here's a very well-written Tech-net Article (Shortcut is Win-7 specific I believe, but there are also graphics card manufacturer shortcuts)
However, I did find a program that another forum claims you can create application shortcuts that launch in a specific window called DisplayFusion, check it out
You can also use the command-line utility mentioned here on Superuser <--- Probably the quickest method
Hope this all helps,
This code worked fine for me:
I think the order of the parameters is relevant.