Link to home
Start Free TrialLog in
Avatar of rkneal
rkneal

asked on

How Can I Specify what Screen to Open an Application on?

I am running Windows 7 on a system with 4 monitors.  On login I currently have a batch file running using the Start command to fire up the application multiple times and open different files.  That part is working without issues but the problem I have is all the different sessions of the application open on the same screen/monitor.  I then have to move the files around to the screen I want them on.  I am wondering if there is a way by script (batch file, VBscript,etc) to open the application, specify what file to open, and finally which of the 4 monitors to open it on.  Below is a basic sample of the Start command I am using in my Batch file.

start "Screen1" /MAX /d "C:\Program Files\My Program" MyProgram.exe "\\mydomain\c$\MyFile"
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

I don't know off hand.... and only got one screen at the mo. to check but I believe a shortcut that remembers where it was launched last time will show on the same monitor as the system sees it as one big screen X x Y pixels.

So if you create four shorcuts to your apps, or a batch file, or your one batch file with a parameter etc. that launch one screen each.  Open the command window, right click in the corner and the properties of that batch file and in the Layout tab turn off the "let the system position the window for me" tickbox.  The adjust the position of the window to where you want it and close it (you could do this on the shortcut instead without it open).

If this DOES work for you too then you should be able to launch the shortcut, which will be a .LNK file of whatever you name it, e.g.

START "System 1" "c:\myapp\screen1.lnk"
or
START "System 1" "%userprofile%\desktop\screen1.lnk"
etc.

hth

Steve
Avatar of rkneal
rkneal

ASKER

Thanks for your reply.  I gave what you suggested a shot but it doesnt work for me.  Changing the paramaters on the Layout tab only seems to change where the command window is opened when the batch file is executed.  I also couldnt see any way to edit the Layout for a .LNK shortcut file.  It just keep defaulting to the last screen that i had the application loaded on.  Since I am trying to launch the same application 4 times, just with 4 different files, it opens on what Windows identified as the last screen it was open.

Any other ideas? Thanks.
Ahh Ok, sorry I thought these were command window applications, understood.

I will try when I have a dual monitor hooked later as I have a few ideas of what may work.

Aside from that I believe it is down to the app where it places it's window when it starts, i.e. it could choose to store its location, or not...

What sort of files are these -- if the application is programmable, i.e. VBA in word, excel etc. then it might be do-able by opening them from that.

Steve
Avatar of rkneal

ASKER

The program is called ProcessBook from OSISoft.  It is a graphics viewing tools for Process Control.  You probably won't have access to download it since it is licensed software but I would think if we could get this to work in another application then it should work in my application.i was lookign at programs liek UltraMon and DisplayFusion but I would rather not have to buy and depend on a third party software if I can do what i want with a simple script.
ASKER CERTIFIED SOLUTION
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rkneal

ASKER

Ok well I think I found where app is storing its location.  There is an INI that contains the following section with the location info.

[Startup]
WindowPos=2,3,-1,-1,-1,-1,23,166,983,884
Footer=0
GridSize=12
ConnectorsAvoidConnectors=0
EnableConnectorAttachments=0

The WindowPos is what i need to modify.  Do you you know if there is a way in a batch file to parse the .INI file and when it sees the line with WindowPos it will replace it with a different line?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rkneal

ASKER

Solution was mostly what i needed and got me thinking about how to come to my final solution.
Sorry I couldn't come with anything more specific.  Did you get this working by editing those INI files in the end then?

Steve
Could you post your final solution you are talking about?

Thanks