By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

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]
I can't test because I don't use the shell's viewer, but you might try START on one of them.
You can test with Take Command's File Explorer, if you have Photos as your default for png (or jpg or whatever). START does not help.
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.
I have a SHELLEX.EXE which does this. If you want to try it, copy "ftp://vefatica.net/shellex.zip"
I tried ShellExecute from a vbs script but it didn't give me the next/prev buttons. Your ShellEx application does?
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).

"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).

"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.

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:

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.
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.

Similar threads