Open Windows 10 Photos app from command line

In Windows 10, suppose you have several png files in a folder. If you use the File Explorer to click one, the Photos app opens. And, the right/left arrow keys let you move to the next/previous image. Also, if you hover over the right/left side of the image, it displays "Next"/"Previous", and you can click to move to the next/previous image.

If you type the name of the png file at the command line, the Photos app opens, but it does not let you move to the next/previous image. Is there some way to open it from the command line so it will work like when you click the file?

TCC 27.00.20 x64 Windows 10 [Version 10.0.17134.2026]
 
May 26, 2008
533
4
I was able to confirm the behavioral difference David is seeing. It's not a TCMD issue, same thing happens when you "run" an image file from powershell or cmd. Something special happens when it's launched from Explorer. Not sure how to replicate that behavior from a command prompt yet.
 
May 20, 2008
11,019
88
Syracuse, NY, USA
I have a SHELLEX.EXE which does this. If you want to try it, copy "ftp://vefatica.net/shellex.zip"
1613610720865.png
 
May 26, 2008
533
4
I tried ShellExecute from a vbs script but it didn't give me the next/prev buttons. Your ShellEx application does?
 
May 20, 2008
11,019
88
Syracuse, NY, USA
It didn't work for me either. But what's funny ... Here's the command line when I 2-click on a JPG (and I get the Next/Previous buttons).

Code:
"C:\Program Files\WindowsApps\Microsoft.Windows.Photos_2019.19071.17920.0_x64__8wekyb3d8bbwe\Microsoft.Photos.exe" -ServerName:App.AppXzst44mncqdg84v7sv6p7yznqwssy6f7f.mca

And here's the command line when it's started by SHELLEX.EXE (and I don't get the buttons).

Code:
"C:\Program Files\WindowsApps\Microsoft.Windows.Photos_2019.19071.17920.0_x64__8wekyb3d8bbwe\Microsoft.Photos.exe" -ServerName:App.AppXzst44mncqdg84v7sv6p7yznqwssy6f7f.mca
 
So, you still can't get it to work from the command line?

I found the following. It works to start the Photos app, but I can't pass the filename to it to get it to open the photo.


 
May 26, 2008
533
4
I also found this:


you can "start ms-photos:" and it launches the Photos app. According to that document, you can use a custom URI like:

Code:
start ms-photos:viewer?fileName=c:\users\userName\Pictures\image.jpg

But it didn't work for me. I'm guessing the documentation is out of date. Very few hits if you try to Google this URI usage.
 
May 20, 2008
11,019
88
Syracuse, NY, USA
Using "ms-photos;" with a file name didn't work for me either. But if, you start it like that, choose "folders" at the top, and add the folder in question, then the next time you "start ms-photos:viewer" you get thumbnails and if you view one of the files, you get the Next/Previous arrows.

If you start it some other way, like "start path\arnex4.JPG" and click "See all photos" you get the thumbnails (as above) and the arrows after opening one of the thumbnails.

In short, making the folder "known" helps.