1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? (un)Sorted Environment Variables and executable extensions using wildcards

Discussion in 'TCC/LE Support' started by tmpease, Nov 2, 2012.

  1. tmpease

    Joined:
    Jan 22, 2009
    Messages:
    10
    Likes Received:
    0
    I have been using JP Software products for over 20 years. Most of my work was with 4DOS, but I'm now working with TCC/LE and TCMD.

    In 4DOS if you entered, for example,

    SET .txt=notepad.exe​
    SET .*=LIST​
    README.TXT​

    , then notepad would execute and load README.TXT . Any other non-.TXT file would cause LIST (the "default") to execute.

    In WinXP (and Vista and Win7 and Win8?), the environment is sorted, so the "default" .* executable extension becomes the "ONLY" executable extension. In the example above, all file.ext would be LISTed, including README.TXT ! SETting any other executable extensions would also be overridden by the .* value. Also... using other wildcard variable names (example .tx?) also causes "overrides" regardless of when they are SET.

    Is there any way to make executable extensions using wildcards work like they used to?

    Can TCC be modified to use the environment in its unsorted form?
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,372
    Likes Received:
    40
    There is no 'unsorted' environment in NT; the environment is always kept sorted for speed reasons. But brackets come after the alphabet, so you could do something like this:

    Code:
    set .txt=notepad.exe
    set .[?]*=list
    
    That said, I suggest reconsidering the whole strategy of making everything executable. If nothing else, it's going to dumb down filename completion at the start of the command line. It might be simpler in the long run to create one-letter aliases for LIST, START, and so on.
     

Share This Page