You want to call a cmdline-tool, but this tool only supports only one file per invocation? But you have to process hundreds of files? With the following approach (in combination with the Totalcommander) you can select many files and handle each file sequentially.
- create a batchfile named foreach.bat
@echo off REM call it via 'foreach.bat filewithfilenames' SET filewithfilenames=%1 for /f %%f IN (%filewithfilenames%) do ( REM insert your code here, the current iteration item is %%f echo %%f )
- create a startermenu entry in totalcommander
- mark all files to be adressed in Totalcommander
- call the newly created startermenu entry “
When calling the startermenu-entry the Totalcommander will save the filenames of the selected files in a temp-file and will provide the filename of the temp-file as parameter. That is the magic of the parameter
%L. (Perhaps such a scheme is also available in Speedcommander, Freecommander and other tools like that?! I do not know…)
Now this temp-file can easily be read using a special syntax of the “
for-loop” of the Windows command line (cmd). Type in
"for /?" in your cmdline for more details on this syntax and see the example above (<code>%%f</code> in line 6).