Skip to content

How to run Exe with parameters? #1155

Answered by andrewleader
ghost1372 asked this question in Q&A
Discussion options

You must be logged in to vote

Actually I read this wrong... so the scenario is you want to distribute an EXE alongside your WinUI 3 MSIX desktop app, and you want to launch that EXE dynamically from your code as full trust.

Since a WinUI 3 app is a desktop app, you can use the Process.Start API. Here's a full example of launching the VS installer, distributed within the app itself, requesting it to run elevated. You don't need to specify any <desktop:Extension> in your manifest either. You should be able to pass arguments via Process.Start too. And this works on Windows 10 😊

The thing that doesn't work on Windows 10 (only Windows 11) is running your own WinUI 3 app as elevated/admin. But you can request another proce…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@dhoehna
Comment options

@andrewleader
Comment options

@dhoehna
Comment options

@riverar
Comment options

@andrewleader
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by andrewleader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants