Start external program for every selected file

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
cwig
Junior Member
Junior Member
Posts: 2
Joined: 2009-12-03, 15:44 UTC

Start external program for every selected file

Post by *cwig »

Is it possible to start a specific program from the Start menu for every selected file?
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

If you have Windows defined default program for the particular extensions, then yes:
command: CMD.exe /c StartSelected.cmd
parameters: %S

Code: Select all

:: 
:: StartSelected.cmd
::
:StartProgram
IF "%~1"=="" GOTO:EOF
START "" "~%1"
SHIFT /1
GOTO:StartProgram
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

I recommend bat packer plugin.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

The only "BAT packer" plugin I see on either totalcmd.net or en.totalcmd.pl is Ghisler's MakeBat v1.3 -- which I don't see how that is even relevant to the question at hand: launching multiple selected files.

MakeBat v1.3
Write-only plugin to create batch files (*.bat) with all the selected files, e.g. for repetitive tasks. May also be used to create mp3 playlists.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

#5767 Personal license
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

From what I can tell from L2M's readme. List2Multi needs a very specific command path; within which you have to indicate which program.exe you want to use to open the current selected files.

That doesn't seem to be any more functional than TC's Internal-Association. If all the files are to be opened by the same program, then you could select them & rightClick + Open Internal (or assign a button or keyboard shortcut to cm_ContextMenuInternal).
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I'm doing this via internal associations, e.g. for Text files:
*.txt
New verb "open all with notepad", command:
notepad.exe "%1"

You can find this command in the context menu then. Contrary to Windows associations, TC's internal support multiple files.
Author of Total Commander
https://www.ghisler.com
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

That only works if all the files are valid to open with the same program. If you select files (different .ext) that have been configured to open with different programs,
Then you only get the Windows Open on right-click.
And nothing happens at all on double-click.

Optimally, if multiple-extensions are selected and it would entail multiple programs launching, TC would present you with:
Open with default in the context menu, which would launch the first program defined for each extension.
User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 03-12-2009 23:18:32 +0000 sqa_wizard wrote:

sw> I recommend List To MultiInstance

+1

This is mine tool of choice in such a case as well - L2M supports relative paths, so I use it with Commander from my flashdrive to run my application regardless of current system association etc.

E.g. my favorite MP3 player is STP, and I use L2M to lunch STP from Commander with selected files as parameters (STP does not support list file as command line parameter):

Code: Select all

Command:    %COMMANDER_PATH%\tools\l2m.exe
Parameters: /X:"stp.exe" /E:-g /L:"%L" /W /O:3
Start path: %COMMANDER_PATH%\..\STP\
[/face][/size]
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2Balderstrom
Then you only get the Windows Open on right-click.
And nothing happens at all on double-click.
For me it's works fine on right-click even when including different internal associations into the selection.
Ghisler never claimed that it works on double-click. Double-click behavior should be improved. Double-click should execute the standard action.

2Black Dog
This is mine tool of choice in such a case as well - L2M supports relative paths, so I use it with Commander from my flashdrive to run my application regardless of current system association etc.
Internal associations can be used on the go as well.
User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 07-12-2009 22:15:08 +0000 Lefteous wrote:

L> Internal associations can be used on the go as well.

Did I say they can't? %) But L2M is good old stuff and still working nova days.[/face]
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Balderstrom wrote:The only "BAT packer" plugin I see on either totalcmd.net or en.totalcmd.pl is Ghisler's MakeBat v1.3 -- which I don't see how that is even relevant to the question at hand: launching multiple selected files.

MakeBat v1.3
Write-only plugin to create batch files (*.bat) with all the selected files, e.g. for repetitive tasks. May also be used to create mp3 playlists.
Yes, it's this one.
You create a bat with "%N" command and run it.
It's quite flexible, you can add parameters etc.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

m^2 wrote:
Balderstrom wrote:The only "BAT packer" plugin I see on either totalcmd.net or en.totalcmd.pl is Ghisler's MakeBat v1.3 -- which I don't see how that is even relevant to the question at hand: launching multiple selected files.

MakeBat v1.3
Write-only plugin to create batch files (*.bat) with all the selected files, e.g. for repetitive tasks. May also be used to create mp3 playlists.
Yes, it's this one.
You create a bat with "%N" command and run it.
It's quite flexible, you can add parameters etc.
Perhaps, but I don't see it as able to do anything except cycle thru a list of files and issue a command (or more) to process said file(s).
A basic script can do that with a FOR loop to generate a list of files with DIR, or GOTO like I posted above (if you have selected files), and you can add additional logic into a script that cannot be done with MakeBAT. Honestly I wouldn't call that quite flexible -- I'd say that's pretty limited in scope.
Post Reply