File completion without space/executable extensions

Aug 31, 2011
14
0
I'm sure this is a simple thing, but I've confused myself by going in circles through the manual.

If I want to file complete PDFs from the empty command line without having to type an initial space, and have it open whatever is in the ASSOC/FTYPE for pdfs do I need to do all this:

@SET .PDF=%@word[0,%@ftype[%@assoc[.pdf]]]

Or is there some more obvious way that defaults to using the registry association? Thanks.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,824
48
Albuquerque, NM
prospero.unm.edu
I'm sure this is a simple thing, but I've confused myself by going in circles through the manual.

If I want to file complete PDFs from the empty command line without having to type an initial space, and have it open whatever is in the ASSOC/FTYPE for pdfs do I need to do all this:

@SET .PDF=%@word[0,%@ftype[%@assoc[.pdf]]]

Or is there some more obvious way that defaults to using the registry association? Thanks.
Well, you could

Code:
set .pdf=start /pgm
Amounts to pretty much the same thing.
 
May 20, 2008
9,276
62
Syracuse, NY, USA
On Thu, 01 Dec 2011 21:59:15 -0500, wcfi <> wrote:

|Or is there some more obvious way that defaults to using the registry association? Thanks.

There is. Read about the PathExt option and the PATHEXT environment variable.
In short, turn on the PathExt option (if needed) and add ";.PDF" to the PATHEXT
environment variable.