I want to write a powershell script that opens unique instances of the same program, with input arguments to it. But my problem is when I use the example code below - the xml-file is opened in the same program window. Not in unique windows.
So, first example. When I execute the following code I get four instances of the program opened.
start-process "C:\Program Files\OCAD\OCAD 2018 Mapping Solution\OCAD 2018 Mapping Solution_64bit.exe"
Start-Sleep -Seconds 10
start-process "C:\Program Files\OCAD\OCAD 2018 Mapping Solution\OCAD 2018 Mapping Solution_64bit.exe"
Start-Sleep -Seconds 10
start-process "C:\Program Files\OCAD\OCAD 2018 Mapping Solution\OCAD 2018 Mapping Solution_64bit.exe"
Start-Sleep -Seconds 10
start-process "C:\Program Files\OCAD\OCAD 2018 Mapping Solution\OCAD 2018 Mapping Solution_64bit.exe"
All good so far.
I can also open the program with xml-file input and by that starting a script. This is done with this code:
start-process "C:\Program Files\OCAD\OCAD 2018 Mapping Solution\OCAD 2018 Mapping Solution_64bit.exe" "D:\laserkartor\18A003\open.xml"
Still all is fine.
But when I run the following code, with the attempt to open four separate windows/instances and running the four different scripts in parallel - they are opened in the same window instead of four different windows.
$proc1 = start-process "C:\Program Files\OCAD\OCAD 2018 Mapping Solution\OCAD 2018 Mapping Solution_64bit.exe" "D:\laserkartor\18A003\open.xml" -PassThru
Start-Sleep -Seconds 10
$proc2 = start-process "C:\Program Files\OCAD\OCAD 2018 Mapping Solution\OCAD 2018 Mapping Solution_64bit.exe" "D:\laserkartor\18A005\open.xml" -PassThru
Start-Sleep -Seconds 10
$proc3 = start-process "C:\Program Files\OCAD\OCAD 2018 Mapping Solution\OCAD 2018 Mapping Solution_64bit.exe" "D:\laserkartor\18A031\open.xml" -PassThru
Start-Sleep -Seconds 10
$proc4 = start-process "C:\Program Files\OCAD\OCAD 2018 Mapping Solution\OCAD 2018 Mapping Solution_64bit.exe" "D:\laserkartor\18B029\open.xml" -PassThru
Start-Sleep -Seconds 10
Any idea of how I can solve this?