Describe the bug
If user use Win+R and type "Notepads" then hit enter, it cause the "File open Error - Failed to open the file "C:\Users\pnp0a\AppData\Local\Microsoft\WindowsApps\Notepads.exe".
If type "Notepads (filepath)", Notepads launch with blank file. the specified file will not open.
To Reproduce
Expected behavior
Launch the app without error. If the user specify the file, open it.
Screenshots

Desktop (please complete the following information):
Additional context
I have some findings about the issue. Let me describe...
The error was caused by "Parse error" of command line parameter. The parser method "RemoveAppNameFromCommandLineIfAny" failed the parsing and return the application path as file path.
Currently, this method assume the args parameter as following 2 pattern:
Notepads.exe c:\users\pnp0a\documents\hoge.txtNotepads c:\users\pnp0a\documents\hoge.txtBut, if the user use Win+R, the parameter is like following.
"C:\Users\pnp0a\AppData\Local\Microsoft\WindowsApps\Notepads.exe" c:\users\pnp0a\documents\hoge.txtRemoveAppNameFromCommandLineIfAny does not suppose the last pattern, then it fails to process.
On my understanding, parsing the command line param with C#, or generate the Application Part and subtract it like as current method , both have some risk but easy to implement.
Most stable way to retrieve only file parameter is simply use the static void Main(string[] args) at Program.cs, I believe. But it requires many of modifications, it's too difficult for me :).
This is the same root cause for https://github.com/JasonStein/Notepads/issues/198
I need to write a proper command line parser since I started to use multi-instance feature and by default, the command line is not parsed in this case causing the issue.
I wrote a minimum workaround here: https://github.com/JasonStein/Notepads/commit/f9e843b947a0babad1535e179b6259b5dc2d5875
I will revisit this code later when I have time. But this fix should work for all use cases: CMD, PS and RUN
I've tried it and it's OK 馃憤