Page 1 of 1

Command line parameter to open file using internal association

Posted: 2024-07-30, 08:33 UTC
by bigheadghost

Code: Select all

totalcmd.exe  /someflag  filename
according to internal association configuration of totalcmd, open the file with related program.

usage senario:
search with everything from voidtools, click some file(s) in the result list, call totalcmd as above. since file association has already been defined.

Re: Command line parameter to open file using internal association

Posted: 2024-07-30, 13:09 UTC
by tuska
Hi,

If I have understood your suggestion correctly, then I regret to inform you that it is NOT possible
to open a file by double-clicking in 'Everything' with an application defined in Total Commander
with the function "Internal Associations (Total Commander Only)...".

If a file is to be opened directly in 'Everything' by double-clicking with the desired application,
then the corresponding settings are required in 'Everything' 1.5a:

References:
  1. Custom Open Commands - Everything 1.5.0.1355a - 17.8.2023
  2. INI Setting - custom_open_commands
    Attention: Do not use this sample code!... Please see: Custom Open Commands and the example below.
    CODE: Change any "name":"..." values to: "name":""
    I informed the author of 'Everything' by email on 30 July 2024.
    EDIT: This information was updated on 31.7.2024 by the author of 'Everything': INI Setting - custom_open_commands

    Code: Select all

    [{"name":"IrfanView","type":2,"filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"MPC-HC64","type":2,"filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"TC","type":2,"filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\Totalcmd64.exe\" /O /A /S \"%1\")"}]
    "The command is shown in the context menu with the specified "name"."
    A right click on a .psd file, then on menu item "IrfanView" opens a .psd file in IrfanView.

    Code: Select all

    [{"name":"","type":2,"filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"","type":2,"filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"","type":2,"filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\Totalcmd64.exe\" /O /A /S \"%1\")"}]
    "Use an empty name ("name":"") to make this the default command when opening an item."
    Double-click on a .psd file to open it in IrfanView.
     
  3. EXAMPLE (successfully tested! - double-click on a .psd file):
    Everything Options - 1.5.0.1383a (x64) > Advanced > Search for: custom_open_commands > Value for custom_open_commands:

    Code: Select all

    [{"name":"","type":2,"filter":"*.jpg;*.jpeg;*.psd","command":"$exec(\"C:\\totalcmd\\Tools\\IrfanView-portable-64bit\\IrfanView\\i_view64.exe\" \"%1\")"},{"name":"","type":2,"filter":"*.mp4;*.mov","command":"$exec(\"C:\\Program Files $(x86$)\\K-Lite Codec Pack\\MPC-HC64\\mpc-hc64.exe\" \"%1\")"},{"name":"","type":2,"filter":"*.7z;*.zip","command":"$exec(\"C:\\totalcmd\\Totalcmd64.exe\" /O /A /S \"%1\")"}]
    Adjust the applications and paths and then click on the "Apply"-button, then on "OK".
    Note: *.psd files will open in IrfanView with this setting in Everything instead of Photoshop.
     
  4. NotNull: Notepad++ with the JSON Viewer plugin installed
  5. NotNull: Explanation of parameterisation

Listed below are additional options that allow you to use the
function "Internal Associations (Total Commander Only)..." in Total Commander:

Reference: Search queries in TC using 'Everything'
  1. Search in Total Commander with integration of 'Everything' tool
    Point 1.: TC Parameter --> ed: resp. 2. TC Parameter --> ev:
  2. Search directly in 'Everything'
    1. Transfer from one(!) search result to Total Commander
      Point 16. : Send 'Everything' search results to Total Commander...
      Point 16.1: Context menu entries
    2. Transfer multiple search results to Total Commander
      Point 16.2: Send 'Everything' search results to Total Commander - AutoHotkey (.AHK) SCRIPT

Windows 11 Pro (x64) Version 23H2 (OS Build 22631.3958)
TC 11.03 x64/x86 | 'Everything' 1.5.0.1383a (x64)
Search queries: Total Commander <=> 'Everything' <= Windows Search

Re: Command line parameter to open file using internal association

Posted: 2024-07-30, 14:19 UTC
by bigheadghost
Thank you, tuska.

Yes, Everything has its own file association mechanism with custom_open_commands.

But then we have to maintain two independent configurations, one in TC, and the other in Everything.

Furthermore, besides these two programs, there are many other file managers. And they may also have their own file association settings. Why bother?

If TC steps further and opens a window to this field handling the issue, it can be the only center for file type definitions, associations, comments, tags, rating, etc…

as for the question above, if someflag is implemented in TC, then by setting the following in Everything:

Code: Select all

open_file_command2=$exec(“totalcmd.exe  /someflag %1”)
we can double click file(s) to open them with desired application defined in TC Internal Associations.

Maybe for now it is not possible. I wish it could in the future.

Re: Command line parameter to open file using internal association

Posted: 2024-07-30, 20:54 UTC
by hi5
Just as an alternative for the time being: If you don't mind using F4 instead Enter you could give https://github.com/hi5/F4MiniMenu a spin, works with TC (best), but also more or less with Everything, Explorer, Double Commander.

Re: Command line parameter to open file using internal association

Posted: 2024-07-31, 08:19 UTC
by tuska
The information here under point 2. has been updated.