Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the equivalent of the System.Diagnostic.Process on WinRT (C#)?

I need to launch a couple of commands from my WinRT application, like if it were a Command Console, in order to do this, on not WinRT apps the class to be used is System.Diagnostic.Process but on Win RT his class is not available, is there any equivalent class or method that i could use?

Thanks in advance :)

like image 582
Marylin Alarcon Avatar asked Oct 07 '12 02:10

Marylin Alarcon


Video Answer


2 Answers

Windows Store Apps cannot launch other processes directly, as Marylin already said. You can only use Launcher.LaunchFileAsync to launch the default application for the file type (file ending) the passed file has. Using this you could define a self-defined file type like .process in Windows and set its handler application to a windowless desktop application you write. The desktop application reads the process file which has the path to the application stored that is to start and launches it using Process.

This trick would certainly fail the certification but may be useful in apps you deploy to businesses skipping the Store. A problem would be that the Windows Store App is set to the background if a Desktop application is launched. I think this is one reason that Microsoft does not allow it for certified apps.

like image 158
Jürgen Bayer Avatar answered Sep 20 '22 13:09

Jürgen Bayer


You cannot do that from a Windows Store application - those are sandboxed and do not have access to other processes. More details here.

like image 30
Den Delimarsky Avatar answered Sep 17 '22 13:09

Den Delimarsky