{"id":417,"date":"2026-11-17T09:00:57","date_gmt":"2026-11-17T17:00:57","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/insidemsix\/?p=417"},"modified":"2026-11-15T17:44:31","modified_gmt":"2026-11-16T01:44:31","slug":"activation-via-command-line","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/insidemsix\/activation-via-command-line\/","title":{"rendered":"Activation via Command Line"},"content":{"rendered":"<h1>Activation via Command Line<\/h1>\n<p>We explored how to <a href=\"https:\/\/devblogs.microsoft.com\/insidemsix\/activation-via-appusermodelid\/\">activate a packaged application by its AppUserModelId<\/a>\n(aka AUMID), but that&#8217;s not always convenient. Some tools only know how to run programs via a\ncommand line.<\/p>\n<p>But fret not. You can activate apps via a command line.<\/p>\n<h2>AppExecutionAlias<\/h2>\n<p>The most popular option is to activate an app via its declared <a href=\"https:\/\/learn.microsoft.com\/uwp\/schemas\/appxpackage\/uapmanifestschema\/element-uap5-appexecutionalias\">AppExecutionAlias<\/a>.<\/p>\n<p>A packaged app can define one or more app execution aliases. An execution alias behaves like a traditional command-line executable, but launching the alias actually activates the packaged application.<\/p>\n<p>Let&#8217;s take the example we used to activate an app via AppUserModelId and add an AppExecutionAlias:<\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;Package ...&gt;\n  &lt;Identity Name=\"Contoso.PointOfSale\"\n            Publisher=\"CN=Contoso LLC, O=Contoso LLC, L=Paris, C=France\"\n            Version=\"1.2.3.4\"\n            ProcessorArchitecture=\"x64\" \/&gt;\n  ...\n  &lt;Applications&gt;\n    &lt;Application Id=\"CardReader\" Executable=\"PointOfSale.exe\" ...&gt;\n    ...\n    &lt;Extensions&gt;\n      &lt;uap5:Extension Category=\"windows.appExecutionAlias\"&gt;\n        &lt;uap5:AppExecutionAlias&gt;\n          &lt;uap5:ExecutionAlias Alias=\"cardreader.exe\" \/&gt;\n        &lt;\/uap5:AppExecutionAlias&gt;\n      &lt;\/uap5:Extension&gt;\n    &lt;\/Extensions&gt;\n...\n&lt;\/Package&gt;\n<\/code><\/pre>\n<p>Windows creates the app execution alias <code>cardreader.exe<\/code> for the user when the package is <a href=\"https:\/\/devblogs.microsoft.com\/insidemsix\/there-is-no-install-its-stage-and-register\/\">registered for a user<\/a>.<\/p>\n<p>Launching the alias activates the packaged application in the same way as activation via AUMID. Any command-line arguments are forwarded to the application, e.g.<\/p>\n<pre><code>cardreader.exe --merchant Contoso --device USB0\n<\/code><\/pre>\n<p>Execution aliases are often the simplest integration point for command-line tools, scripts, scheduled tasks, installers, and other software that expects to launch an executable rather than activate an application by AUMID.<\/p>\n<h2>Where are the aliases?<\/h2>\n<p>Registration creates the alias in the user&#8217;s profile<sup>1<\/sup>, e.g.\n<code>C:\\Users\\bob\\AppData\\Local\\Microsoft\\WindowsApps\\cardreader.exe<\/code>. This directory is included in the\nuser&#8217;s <code>PATH<\/code>, making aliases convenient for interactive as well as programmatic use.<\/p>\n<p>If you look in the user directory, you&#8217;ll see <code>*.exe<\/code> files but their size is always 0 bytes.<\/p>\n<p>Don&#8217;t Panic.<\/p>\n<p>Alias files are special file system entries. The activation stack uses the alias to identify the\nactual executable file in a package to activate.<\/p>\n<p>The executable was not copied out of the package&#8217;s install location. It remains\n<a href=\"https:\/\/devblogs.microsoft.com\/insidemsix\/staging-sharing-is-caring\/\">where it was staged<\/a>\nand all its <a href=\"https:\/\/devblogs.microsoft.com\/insidemsix\/msix-chain-of-trust\/\">integrity protection and enforcement<\/a>\nintact.<\/p>\n<h2>Duplicate aliases<\/h2>\n<p>There&#8217;s nothing special or protected about an alias name. Multiple packages can (and do) define\nthe same alias, e.g. multiple graphics applications can declare <code>&lt;uap5:ExecutionAlias\nAlias=\"paint.exe\" \/&gt;<\/code>, but only one can exist in the user&#8217;s alias directory.<\/p>\n<p>MSIX Deployment applies a &#8220;First Writer Wins&#8221; protocol to aliases when registering a package for a\nuser: the alias is only written if no alias with the same name already exists.<\/p>\n<p>An alias in <code>C:\\Users\\bob\\AppData\\Local\\Microsoft\\WindowsApps<\/code> is the moral equivalent to the\ndefault application for a file type association. There can be only one default, or none.<\/p>\n<p>A user can select which alias amongst dupes is enabled via the\n<code>Apps &gt; Advanced app settings &gt; App execution aliases<\/code> page in Settings.\nThis shows the list of aliases across packages registered for the user, and which are enabled. When\nmultiple apps define the same alias, users can choose which app is activated.<\/p>\n<p>Users can disable an app&#8217;s alias. For example, a user could disable Contoso&#8217;s PointOfSale\napplication&#8217;s <code>cardreader.exe<\/code> alias. If no other alias with the same name is enabled, attempts to launch\n<code>cardreader.exe<\/code> will fail, as if the package never existed.<\/p>\n<p>When no alias for a given name is enabled, Windows deletes the file system entry. For example, if no\n<code>cardreader.exe<\/code> alias is enabled then\n<code>C:\\Users\\bob\\AppData\\Local\\Microsoft\\WindowsApps\\cardreader.exe<\/code> won&#8217;t exist.<\/p>\n<p>User-configurable aliases are ideal for interactive use, but automation often requires a predictable\nlaunch target that isn&#8217;t affected by Settings preferences. Deployment also provides a stable\npackage-specific alias.<\/p>\n<h2>Stable path to an alias<\/h2>\n<p>Deployment not only creates the alias in the user profile (if not already present). Package\nregistration also creates the alias in a subdirectory named with the package family name.<\/p>\n<p>This is unconditional, not controlled or modified by the user, and unaffected by Settings&#8217;\n<code>Apps &gt; Advanced app settings &gt; App execution aliases<\/code> page.<\/p>\n<p>For example:<\/p>\n<pre><code>[C:] DIR %LOCALAPPDATA%\\Microsoft\\WindowsApps\n...\n Directory of C:\\Users\\bob\\AppData\\Local\\Microsoft\\WindowsApps\n...\n11\/17\/2026  09:00 AM    &lt;DIR&gt;          Contoso.PointOfSale_eh4htm4n7tdre\n...\n11\/17\/2026  09:00 AM                 0 cardreader.exe\n...\n\n[C:] DIR %LOCALAPPDATA%\\Microsoft\\WindowsApps\\Contoso.PointOfSale_eh4htm4n7tdre\n...\n11\/17\/2026  09:00 AM    &lt;DIR&gt;          Contoso.PointOfSale_eh4htm4n7tdre\n...\n<\/code><\/pre>\n<p>Registering this package for the user always creates e.g.\n<code>C:\\Users\\bob\\AppData\\Local\\Microsoft\\WindowsApps\\Contoso.PointOfSale_eh4htm4n7tdre\\cardreader.exe<\/code>.<\/p>\n<h2>Activate via AUMID vs AppExecutionAlias<\/h2>\n<p>Windows supports activation via AUMID and AppExecutionAlias. Why choose one over the other?<\/p>\n<p>AppExecutionAlias is the common preference for interactive use, as it looks and feels like any other\nexecutable from the user&#8217;s perspective. Plus Windows doesn&#8217;t include a convenient option to\ninteractively launch an application by AUMID.<\/p>\n<p>However, aliases must be declared by the developer in a package&#8217;s <code>AppxManifest.xml<\/code>. Aliases are\nonly created per the package&#8217;s definition.<\/p>\n<p>If the package doesn&#8217;t specify an alias, there won&#8217;t be any aliases. Activation via AUMID would\nbe required.<\/p>\n<hr \/>\n<p><sup>1<\/sup> And of course, Windows deletes the alias in the user&#8217;s profile when the package is\n<a href=\"https:\/\/devblogs.microsoft.com\/insidemsix\/remove-is-not-uninstall\/\">deregistered for the user<\/a>.\nMSIX strives to cleanly uninstall any software it installs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Activation via Command Line We explored how to activate a packaged application by its AppUserModelId (aka AUMID), but that&#8217;s not always convenient. Some tools only know how to run programs via a command line. But fret not. You can activate apps via a command line. AppExecutionAlias The most popular option is to activate an app [&hellip;]<\/p>\n","protected":false},"author":911,"featured_media":81,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[28,17,9,2],"class_list":["post-417","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-msix","tag-activation","tag-application","tag-code","tag-msix"],"acf":[],"blog_post_summary":"<p>Activation via Command Line We explored how to activate a packaged application by its AppUserModelId (aka AUMID), but that&#8217;s not always convenient. Some tools only know how to run programs via a command line. But fret not. You can activate apps via a command line. AppExecutionAlias The most popular option is to activate an app [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/posts\/417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/users\/911"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/comments?post=417"}],"version-history":[{"count":1,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/posts\/417\/revisions"}],"predecessor-version":[{"id":420,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/posts\/417\/revisions\/420"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/media\/81"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/media?parent=417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/categories?post=417"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/tags?post=417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}