Is it possible to launch command to execute commands in UWP?

Xie Steven 811 Reputation points
2023-01-26T09:17:47.82+00:00

Hi,

I want to launch the windows command to execute the specific command with arguments in my UWP app. Is it possible?

Thanks,

Steven

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Roy Li - MSFT 31,786 Reputation points Microsoft Vendor
    2023-01-27T01:35:25.06+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Generally, we use Process.Start() to launch a exe file in desktop app. But this is not supported in UWP becauses UWP apps are running in the sandbox and it is isolated with the system.

    If you want to lanch the cmd.exe from your UWP app, you need make desktop extension by desktop-bridge for UWP app, and call Process.Start() in the desktop extension. For more infomation, you may open your browswer and search for stefan's blog UWP with Desktop Extension – Part 2

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our [documentation][2] to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Castorix31 81,636 Reputation points
    2023-01-26T10:39:12.5766667+00:00

    There was a similar thread : How launch another app from my app UWP?

    0 comments No comments