Suggestion for new command line parameter: path to file

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
pplupo
Member
Member
Posts: 102
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Suggestion for new command line parameter: path to file

Post by *pplupo »

In the help file there are several command-line parameters, but all the ones that accept a path only take paths to directories.
I'd like to have a command-line parameter that would take a path to a file OR to have a switch that would make TCMD accept path to files.

Up to this version, we have the option to run TCMD on a specific directory or to try running a file. I wish TCMD were able to open a directory and select a file (place the cursor on the file).

The reason is simple: several software have the option to "open the file in current dir" or "open file location" and the default behavior of Windows Explorer is to open the location with the file selected (as the directory may have multiple files). I can't replicate this behavior with TCMD because it doesn't seem to support it.

I've been trying to replace Windows Explorer with TCMD, but options to "Open Containing Folder" on Notepad++ or "Show in Folder" (Chrome's downloads) open the directory with the file selected. TCMD can't do that.

Can we have this implemented? :-)
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Suggestion for new command line parameter: path to file

Post by *petermad »

TC already supports that - just use the full path to the file in the command line and TC will open with the cursor on that file. Try for example:

Code: Select all

C:\totalcmd\TOTALCMD64.EXE C:\totalcmd\HISTORY.TXT C:\totalcmd\TOTALCMD.INC
or

Code: Select all

C:\totalcmd\TOTALCMD64.EXE /P C:\totalcmd\HISTORY.TXT C:\totalcmd\Language\
Adjust the path C:\totalcmd\ to match the directory where you have your TC installed.

The /P parameter is to make TC not go into the stated directory (Language), but to place the cursor on the directory.
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
pplupo
Member
Member
Posts: 102
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Re: Suggestion for new command line parameter: path to file

Post by *pplupo »

I think I might have an outdated help file or it's not on the help file. Thank you! :-)
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Suggestion for new command line parameter: path to file

Post by *petermad »

pplupo wrote: 2023-03-02, 19:30 UTC I think I might have an outdated help file or it's not on the help file. Thank you! :-)
I don't think it is actually mentioned in the help, that TC will go to the file if stated in the command line.

The help for command line parameters only says:
Help wrote:Drive:\Directory
Loads the first directory passed to Total Commander into the left window, and the second into the right window. Directory names containing spaces must be put in double quotes! Always specify the full path name including the drive!
To open a stored FTP connection, use FTPOPEN:stored_ftp_name as path.
LOADLIST:path\listfile.txt loads a list of files/folders from the given text file into the file panel, same as the LOADLIST0 button bar command
Also accepts shares in the form \\server\share\subdir or smb://server/share/subdir, and virtual folders in the form shell:Folder or ::{GUID of folder}
Instead of a directory, you can also pass a .tab file to load the saved tabs (replacing the current tabs).
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
pplupo
Member
Member
Posts: 102
Joined: 2019-12-02, 16:26 UTC
Location: Canada
Contact:

Re: Suggestion for new command line parameter: path to file

Post by *pplupo »

Ok, thank you for confirming it. It seems this is a miss in the help file.

I wonder which other switches could be missing.

Thanks to you, my script that replaces Windows Explorer with TCMD now works beautifully. :-)
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Suggestion for new command line parameter: path to file

Post by *petermad »

I wonder which other switches could be missing.
The /P switch is mentioned in the help, it is just the fact that you can pass a file name and not just a directory name via the command line that is missing in the help.

BTW the /P parameter also works like the /A parameter - to not enter archive files. So if you use /P you don't need to use /A
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
Post Reply