# Trigging the Mail app with Powershell

**URL:** <https://forums.powershell.org/t/trigging-the-mail-app-with-powershell/16944>\
**Category:** PowerShell Help\
**Created:** [June 29, 2021, 2:53am UTC](https://forums.powershell.org/t/trigging-the-mail-app-with-powershell/16944 "2021-06-29T02:53:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Sherriff](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@Steve\_Sherriff](https://forums.powershell.org/u/Steve_Sherriff)\
**Post date:** [June 29, 2021, 2:53am UTC](https://forums.powershell.org/t/trigging-the-mail-app-with-powershell/16944/1 "2021-06-29T02:53:57Z")

</div>

Hi,

I have a Powershell script that I run at the start of day to trigger my most used applications.I’ve been using the following command:

start “shell:AppsFolder$(Get-StartApps “Your Phone” | select -ExpandProperty AppId)”

Which launches the “Your Phone” app without issue. I have tried to do the same with the Windows 10 email app:

start “shell:AppsFolder$(Get-StartApps “Mail” | select -ExpandProperty AppId)”

But I get an error

start : This command cannot be run due to the error: The system cannot find the file specified.

At line:1 char:1

- start "shell:AppsFolder$(Get-StartApps “Mail” | select -ExpandProper …

- 

```auto

  + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException 

  + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

```

So then I tried:

start “shell:AppsFolder$(Get-StartApps “Mail and Calendar” | select -ExpandProperty AppId)”

No error, but it only opened the application folder.

I then used:

Get-AppxPackage -AllUsers | Select Name, PackageFullName

But this didn’t show a Mail app. I believe that the Mail app is part of “microsoft.windowscommunicationsapps” but running:

start “shell:AppsFolder$(Get-StartApps “microsoft.windowscommunicationsapps” | select -ExpandProperty AppId)”

Just opens the Application folder.

Any ideas what the correct command should be?

Thanks

Steve

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [June 29, 2021, 6:36am UTC](https://forums.powershell.org/t/trigging-the-mail-app-with-powershell/16944/2 "2021-06-29T06:36:13Z")

</div>

Steve,  
Welcome to the forum.

I’d start with listing ALL the possible apps and looking for the one needed with

```auto
Get-StartApps | Sort-Object -Property Name

```

Regardless of that - please when you post code, error messages, console output or sample data format it as code using the “_preformatted text_” button ( **\</\>** ).

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Steve\_Sherriff](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@Steve\_Sherriff](https://forums.powershell.org/u/Steve_Sherriff)\
**Post date:** [June 29, 2021, 8:32am UTC](https://forums.powershell.org/t/trigging-the-mail-app-with-powershell/16944/3 "2021-06-29T08:32:34Z")

</div>

Hi Olaf,

Thanks for taking the time to reply. Using your command I found Mail listed as:  
`Mail microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.windowslive.mail`

So in theory this command should work?  
`start “shell:AppsFolder$(Get-StartApps “Mail” | select -ExpandProperty AppId)”`  
Or am I missing something?

Sorry about the bad formatting, I think that I got it right this time.

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [June 29, 2021, 9:49am UTC](https://forums.powershell.org/t/trigging-the-mail-app-with-powershell/16944/4 "2021-06-29T09:49:44Z")

</div>

> [@Steve\_Sherriff](#):
>
> So in theory this command should work?  
> `start “shell:AppsFolder$(Get-StartApps “Mail” | select -ExpandProperty AppId)”`  
> Or am I missing something?

To be honest … I don’t know. I’m not using the “Your Phone” app and it does not work with any of the apps available on my computer.

I’d rather use the complete path of the desired app and run it this way. 😉

> [@Steve\_Sherriff](#):
>
> Sorry about the bad formatting, I think that I got it right this time.

Almost. Simply click on the “_preformatted text_” button ( **\</\>** ) first and then paste the code in the position that is shown to you. 😉

---

<div class="post-metadata">

**Author:** ![tonyd](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/tonyd/32/1041_2.png) [@tonyd](https://forums.powershell.org/u/tonyd)\
**Post date:** [June 29, 2021, 1:45pm UTC](https://forums.powershell.org/t/trigging-the-mail-app-with-powershell/16944/5 "2021-06-29T13:45:03Z")

</div>

This is a curiosity question. Does this app not live by the rules of Windows 10 whereby any app open when you shut down Windows is automatically loaded when you restart?

I personally dont like this behavior and so do a fair number of users in a google search. Again, I am just curious why you have to use a script to get this done. Thanks.

---

<div class="post-metadata">

**Author:** ![Steve\_Sherriff](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@Steve\_Sherriff](https://forums.powershell.org/u/Steve_Sherriff)\
**Post date:** [June 30, 2021, 12:52am UTC](https://forums.powershell.org/t/trigging-the-mail-app-with-powershell/16944/6 "2021-06-30T00:52:20Z")

</div>

I have not found a way to use the complete path of a Windows store app, they don’t reside in the usual folders.

---

<div class="post-metadata">

**Author:** ![Steve\_Sherriff](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@Steve\_Sherriff](https://forums.powershell.org/u/Steve_Sherriff)\
**Post date:** [June 30, 2021, 12:54am UTC](https://forums.powershell.org/t/trigging-the-mail-app-with-powershell/16944/7 "2021-06-30T00:54:50Z")

</div>

Hi Tony,

I’m not trying to trigger this group of apps to open every time that I startup. Instead I have a single button in the Start menu that triggers all of my messaging apps when required.

It was actually a little project to get me using Powershell, but now it has me scratching my head!

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [June 30, 2021, 8:00am UTC](https://forums.powershell.org/t/trigging-the-mail-app-with-powershell/16944/8 "2021-06-30T08:00:45Z")

</div>

> [@Steve\_Sherriff](#):
>
> I have not found a way to use the complete path of a Windows store app, they don’t reside in the usual folders.

I’m not using Windows Store Apps at all but I googled it for you and found this:

> **[Method to open any Windows 10 Apps from command line - Windows 10 Help Forums](https://www.tenforums.com/software-apps/57000-method-open-any-windows-10-apps-command-line.html)**
>
> Hi everyone, I am here to share how to open any Windows 10 Apps from command line. 1. Open Code: shell:AppsFolder 2. Find your app 3. Right click and

and this:

[https://answers.microsoft.com/en-us/windows/forum/all/starting-windows-10-store-app-from-the-command/836354c5-b5af-4d6c-b414-80e40ed14675](https://answers.microsoft.com/en-us/windows/forum/all/starting-windows-10-store-app-from-the-command/836354c5-b5af-4d6c-b414-80e40ed14675)

---

<div class="post-metadata">

**Author:** ![Steve\_Sherriff](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@Steve\_Sherriff](https://forums.powershell.org/u/Steve_Sherriff)\
**Post date:** [June 30, 2021, 8:34am UTC](https://forums.powershell.org/t/trigging-the-mail-app-with-powershell/16944/9 "2021-06-30T08:34:07Z")

</div>

Hi,

Very kind of you! That worked a treat. Thank you.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:23pm UTC](https://forums.powershell.org/t/trigging-the-mail-app-with-powershell/16944/10 "2024-05-16T20:23:57Z")

</div>


