Can I create a verb to pass multiple files to a program?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
jiangzhenjerry
Junior Member
Junior Member
Posts: 58
Joined: 2016-01-15, 23:57 UTC

Can I create a verb to pass multiple files to a program?

Post by *jiangzhenjerry »

I'm not sure if the title is clear enough, so I will try my best to explain it with an example. Let's say I created a context menu item to play .mp4 files with MPV player:

Code: Select all

Filter1=*.mp4
Filter1_MPV=mpv.exe "%1"
Now if I multi-select two files - "1.mp4" and "2.mp4" - from the file list, right click on the selection, and choose "MPV (Internal)", the following commands are executed:

Code: Select all

mpv.exe "1.mp4"
mpv.exe "2.mp4"
and therefore two MPV windows will pop up simultaneously, one playing "1.mp4" and the other playing "2.mp4".

My question hence is: is it possible to write a verb such that it would execute:

Code: Select all

mpv.exe "1.mp4" "2.mp4"
This way, only one MPV window will pop up, with the two files added to its playlist. This is not unique to MPV, but many other media players and applications too.

Thank you and excuse me if I'm daydreaming :P It may as well be a limitation of Windows File Explorer.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Can I create a verb to pass multiple files to a program?

Post by *petermad »

2jiangzhenjerry
Try and change:

Code: Select all

Filter1_MPV=mpv.exe "%1"
to:

Code: Select all

Filter1_MPV=mpv.exe "%2"
or:

Code: Select all

Filter1_MPV=mpv.exe %2

Help wrote:Open
Program used for the 'open' action. This is always the default verb (used when pressing ENTER) for internal associations. You need to put %1 or "%1" (or %2) behind the program name so the file is passed as a parameter. The difference between %1 and %2 only appears when right clicking on multiple files. Choosing an internal command with %1 will open all selected files in separate editors, while %2 will pass them all to the same program. This will of course only work when that editor can accept multiple files as parameters
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
jiangzhenjerry
Junior Member
Junior Member
Posts: 58
Joined: 2016-01-15, 23:57 UTC

Re: Can I create a verb to pass multiple files to a program?

Post by *jiangzhenjerry »

@petermad

You save my life :D Thank you so much for your help! I should have read the Help file more carefully....
Post Reply