Instruct TC to load filelist from command line
Moderators: Hacker, petermad, Stefan2, white
Instruct TC to load filelist from command line
I'm using a script from within TC that produces text file with full paths to targeted files. Now I wanted to launch TC from command line and instruct it to read the created filelist, but I can' t see such switch in TC help file.
If it's of any importance, files in generated filelist are located in same folder, so for manual resolution, I could instruct TC to load the folder in which files reside and use "cm_LoadSelectionFromFile" button to browse for filelist file, and then use "cm_ShowOnlySelected" button to filter results, but this approach seems a bit involved considering initial task, so I thought to ask for possible better solution.
TIA
If it's of any importance, files in generated filelist are located in same folder, so for manual resolution, I could instruct TC to load the folder in which files reside and use "cm_LoadSelectionFromFile" button to browse for filelist file, and then use "cm_ShowOnlySelected" button to filter results, but this approach seems a bit involved considering initial task, so I thought to ask for possible better solution.
TIA
If instead of - or from - your text file you could make a temporary folder and put symbolic links pointing to the targeted files there,
then you can invoke TC like so
The `mklink` command is available from Win Vista upwards and requires admin rights. There are workarounds for 2000/XP.
But be careful if you're going to delete them. It is possible, under circumstances, that rather than the link *the target is deleted instead*!
So testing with dummy files is a good idea.
Even better would be IMHO a custom packer plugin that interprets your list. You would invoke TC then by
EDIT: Hard links might actually be a better choice than symlinks (but packer plugin is still best I think). They're available from XP on via
but they cannot point across volumes (drives). They're basically additional names for the same file, and deleting the last name remaining actually deletes the file; which implies that they cannot point to non-existing targets like symbolic links.
then you can invoke TC like so
Code: Select all
%COMMANDER_EXE% /O /L=C:\TempFolderWithSymlinks\
But be careful if you're going to delete them. It is possible, under circumstances, that rather than the link *the target is deleted instead*!
So testing with dummy files is a good idea.
Even better would be IMHO a custom packer plugin that interprets your list. You would invoke TC then by
Code: Select all
%COMMANDER_EXE% /O /L=your-list.lst
Code: Select all
fsutil.exe hardlink create
If you add a line at the top of the list containing drive and root folder (c:\) the diskdir plugin could be used. But the diskdir plugin doesn't support unicode. There is also the dirkdirw plugin supporting unicode, but I don't know if it is any good.meisl wrote:Even better would be IMHO a custom packer plugin that interprets your list. You would invoke TC then byCode: Select all
%COMMANDER_EXE% /O /L=your-list.lst
Another approach is to use search (search in @c:\path\filelist.txt, see Help) and feed the results to TC's file panel.
I tried "diskdir" plugin which indeed can't handle Unicode.
"diskdirw" works fine if filelist is encoded in UTF-8 variant of Unicode, and that is the solution I'm using now. Thanks!
Using "@files.lst" in "Search in" input box of Search dialog with "*" pattern in "Search For" inputbox, and then saving the search and binding button to "LOADSEARCH" command is yet another fine approach.
I wish I was patient and wait for your replies before heading to ActiveX plugin, although exposed TC as COM object was another good find.
Cheers
"diskdirw" works fine if filelist is encoded in UTF-8 variant of Unicode, and that is the solution I'm using now. Thanks!
Using "@files.lst" in "Search in" input box of Search dialog with "*" pattern in "Search For" inputbox, and then saving the search and binding button to "LOADSEARCH" command is yet another fine approach.
I wish I was patient and wait for your replies before heading to ActiveX plugin, although exposed TC as COM object was another good find.
Cheers
For completeness: diskdirw on totalcmd.net
If I understand your right, I guess I used wrong words, and would like to explain - by "lister window" I meant file panel window, like lister in a sense of file listview and not in a sense of lister plugin. So I find file panel fed from search dialog more useful, not file panel from "diskdirw" pluginwhite wrote:This is also available when using the command line parameter to start the search. If a Total Commander window is open, search results can be fed to TC's file panel.obmana wrote:..but lister window feed from search dialog is more useful to me

- display files from different locations (drives)
- show thumbnails
- send files to virtual panel
- filter nonexistent files
...
Sorry for chipping in again,
You know, I'm looking for example plugins I could write using tc_java. This one looked like a good candidate since it's not too involved - until white mentioned diskdirw...
But now - if you'd still be interested in trying it - I'd write it.
...oops. Haven't (yet) tried diskdirw myself, but I was assuming it would in fact provide all that.obmana wrote:For example file panel from "diskdirw" can't, while file panel from search dialog can:
- display files from different locations (drives)
- show thumbnails
- send files to virtual panel
- filter nonexistent files
You know, I'm looking for example plugins I could write using tc_java. This one looked like a good candidate since it's not too involved - until white mentioned diskdirw...
But now - if you'd still be interested in trying it - I'd write it.

Thanks obmana, for your kind words!
The (one!) JVM is loaded at TC startup, and when using the /O option (ie, send data to a currently running TC instance) there wouldn't be any noticeable lag.
Of course, actually trying Java plugins presupposes having installed tc_java once. I'm working on making that as easy as possible, too.
So well, I'll keep this one on my list for packer plugins, as it's got other aspects that make it a good example (for devs).
And maybe, eventually, you may want to take the effort of trying it, and reporting if you think whether it can compete with the other solutions proposed
The (one!) JVM is loaded at TC startup, and when using the /O option (ie, send data to a currently running TC instance) there wouldn't be any noticeable lag.
Of course, actually trying Java plugins presupposes having installed tc_java once. I'm working on making that as easy as possible, too.
So well, I'll keep this one on my list for packer plugins, as it's got other aspects that make it a good example (for devs).
And maybe, eventually, you may want to take the effort of trying it, and reporting if you think whether it can compete with the other solutions proposed
