[2.0.x] Windows: App.open("cmd.exe /c .....") does not work as in 1.1.x --- workaround

Asked by ThinkClouds on 2020-04-18

----------------- workaround see comment #1

------ enhancement bug: https://github.com/RaiMan/SikuliX1/issues/343

I need to start a windows 10 UWP app (installed via the microsoft store, e.g. Amazon Music)
In sikulix 1.1.3 I started this app with AppAmazon = App.focus ("cmd.exe / c" start shell: AppsFolder \ AmazonMobileLLC.AmazonMusic_kc6t79cpj4tp0! AmazonMobileLLC.AmazonMusic ").
with Sikulix 2.x the command does not work. I tried with App.open () and made several attempts with different paths without success.
Any suggestions?
Thanks in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2020-04-21
Last query:
2020-04-21
Last reply:
2020-04-21
Best RaiMan (raimund-hocke) said : #1

The complete App handling on Windows has been revised with a focus on startable applications using there absolute path to the .exe and apps, that open windows at startup.

The above variant does not work anymore. I will add a solution for those cases where you want to use the cmd.exe to do something.

As a workaround try this:

- pack the "start ...." into a .bat or .cmd
- use App.open("youNameIt.cmd")

ThinkClouds (bd-icfj-jj) said : #2

Thanks RaiMan for the reply!
The trick works and allows me to open the app.
Great! :)

Now I ask you if there is a function to take the PID of the app opened in this way.
Thank you!

ThinkClouds (bd-icfj-jj) said : #3

Thanks RaiMan, that solved my question.

RaiMan (raimund-hocke) said : #4

--- function to take the PID of the app opened in this way
try with

myApp = App.focus("significant part of the window title")

ThinkClouds (bd-icfj-jj) said : #5

Thanks RaiMan, that solved my question.