#1 10 Mar 2019 05:33

Zebra
Member
Registered: 10 Mar 2019
Posts: 9

Command Line Function???

Hi,

I'm trying to write a batch file to open a photo viewer application that will load several photos in

multiple different tabs.

So far this is what I've got:

Start C:\Users\(USER NAME)\xnview C:\Users\(USER NAME)\Desktop\Photos\

This command line opens the application (XnView) at the specified "Photos" folder where the photos are

stored.

However, at this point, I am unable to find a command to load specified photos, and I've tried numerous

variations to no avail, and I've searched the internet high and low as well.

I know opening at least one tab is possible since I can open a single photo by manually right clicking it

and specifying the program to open from the context menu.

Do any of you wizzes know how I can accomplish opening photos in several tabs?

Presumably, it would be something like this:

Start C:\Users\(USER NAME)\xnview C:\Users\(USER NAME)\Desktop\Photos\ {?Some "OPEN-FILE" Command?}

Img01.jpg,Img02.jpg, ...etc.

Greatly appreciate any help - Thanks!

Offline

#2 11 Mar 2019 06:41

rway
New Member
Registered: 11 Mar 2019
Posts: 2

Re: Command Line Function???

what if load a photo one by one with FOR loop?

Offline

#3 11 Mar 2019 10:49

bluesxman
Member
From: UK
Registered: 29 Dec 2006
Posts: 1,076

Re: Command Line Function???

As suggested by rway, something like this, perhaps?

for %x in ("C:\Users\(USER NAME)\Desktop\Photos\*.jpg") do start "" "C:\Users\(USER NAME)\xnview" "%~x"

The above is suitable for typing/pasting to the command line only, if you're putting it in a script, then you'll need to tweak it like so:

for %%x in ("C:\Users\(USER NAME)\Desktop\Photos\*.jpg") do start "" "C:\Users\(USER NAME)\xnview" "%%~x"

Be careful what you wish for — if there are a lot of files in the directory this might not go so well.

Depending on how XnView handles being started in this way, you might find you end up with an XnView window per image (rather than tab per image).  I'd play it safe by feeding it a directory with a low number of images first, to figure out the behaviour.

Even then, you may find you experience serious performance issues if you open a few hundred images in one go -- how this goes is very much going to depend on how many images you have, and (to a certain degree) the specs of your computer.

As such, the above is undertaken at your own risk, with no warranties expressed or implied.

Last edited by bluesxman (11 Mar 2019 10:58)


cmd | *sh | Ruby | Chef

Offline

#4 12 Mar 2019 03:43

Zebra
Member
Registered: 10 Mar 2019
Posts: 9

Re: Command Line Function???

My problem is finding a command that will load even just one tab.
I will try your code bluesxman or variations of it and see how it goes.
An alternate plan is to use a macro program that allows scripts and convert the algorithm to an executable file. But it's a bit of a learning curve, so whatever it takes.

Thanks so much guys!

Offline

#5 12 Mar 2019 18:00

rway
New Member
Registered: 11 Mar 2019
Posts: 2

Re: Command Line Function???

I can't get what Zebra really want. My XnView is Classic ver 2.48
(English isn't my native language, sorry.)

And if I execute commands such as "xnvivew.exe p1 p2 p2," I see a XnView window, including 3 tabs of the opened files.
However, "xnvivew.exe albumfolder" just gives me a browser without any tab. Maybe it's up to the Options of XnView, too.

BTW, FOR loop is often also used to read a plain text of file list, especially they are not in the same folder.

Offline

Board footer

Powered by FluxBB