Filename completion at the beginning of the command line?

May 20, 2008
12,382
138
Syracuse, NY, USA
TCC/Windows can execute quite a few file types that TCC won't complete at the beginning of a command line. A few are .URL, .XLSM, .OXPS, .PNG, .DOCX, .LNK, .SLN, .CPP. .H. .WMV, .TXT, .LOG. Is there a way to make TCC complete ALL types at the beginning on a command line without putting them all in PATHEXT and without typing a space before starting the file name?
 
No.

It's only been requested by one person in the last few years (a few others inquired and were satisfied by the space/tab workaround), and IMHO it's a bad idea as it will generate potentially thousands of unwanted matches.
Space/tab ... ? I wasn't accurate. I never want to complete when the command line is blank. But when I've typed something I wan't all possible completions. So for me it's space/type/tab

I'll just add them to PATHEXT as necessary. Today it was .PDF, a few weeks ago, .SLN. The one before that in my PATHEXT is .CHM; I can't remember when I added that one.
 
Vince, have you tried defining executable extensions? For example, I have defined environment variable .pdf to have the value "reader" (no quotes). If I enter some characters on the command line (without any leading space) and hit tab, PDF files are completed. I have defined executable extensions for all the types of files that I want to be found that way. And I do not want path searching for them.
 
Vince, have you tried defining executable extensions? For example, I have defined environment variable .pdf to have the value "reader" (no quotes). If I enter some characters on the command line (without any leading space) and hit tab, PDF files are completed. I have defined executable extensions for all the types of files that I want to be found that way. And I do not want path searching for them.
Don't you get TCC: Unknown command "reader" if you try to execute it after it's completed?

If .PDF is in %PATHEXT, it's completed and, if I press Enter, it's executed. I'm not worried about path searching. I always know what I want and if it isn't in the current directory, I give a path. So I'm pretty sure it's found before any path search.
 
I'm sorry that I wasn't clear. I have simple aliases, such as "reader", that invoke the full command line for the program. My point was that defining an executable extension allows file completion without a leading space.
 
You often don't have to tell TCC how to execute something. For example if you have

Code:
v:\> assoc .pdf
.pdf=AcroExch.Document.DC

v:\> ftype AcroExch.Document.DC
AcroExch.Document.DC="C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe" "%1"

As for the completion ... I just discovered the (not very well known?) INI directive CompleteAllFiles=Yes which does the trick.
 
Indeed. I thought you were saying that a file association was not enough to let TCC do file completion without a leading space. My point was that defining an executable extension does do that.

I was not aware of the CompleteAllFiles directive. However, I think I prefer using executable extensions rather than file associations and the path to control what gets executed and how.

But TCMD/TCC is an amazing product! There are so many ways to accomplish what one wants.
 

Similar threads