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

Fixed There is Batch breaking bug in TCC LE (x64)

Discussion in 'TCC/LE Support' started by miXza-81, Aug 10, 2015.

  1. miXza-81

    Joined:
    Aug 10, 2015
    Messages:
    4
    Likes Received:
    0
    Bug is tested and repeated with two different Win 7 Pro and Win 7 Home computers with TCC LE v14.00.1 & v13.06.77.

    There is difference at output of echo %ProgramFiles(x86)% command when it is executed with TCC LE and standard Windows 7 CMD console. When using TCC LE, single spacebar before (x86) is missing, so output value is invalid... See picture below.


    [​IMG]
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    That behavior is because TCC doesn't consider the parentheses valid characters in an environment variable name. You get the value of the variable %PROGRAMFILES, followed by the literal string "(X86)". The final percent sign does not introduce a variable name, and is ignored.

    You can read the value of that variable using the square-brackets syntax:
    Code:
    echo %[programfiles(x86)]
    
    If you need it often, you can save it to a variable with a nicer name:
    Code:
    set programfiles86=%[programfiles(x86)]
    
     
  3. miXza-81

    Joined:
    Aug 10, 2015
    Messages:
    4
    Likes Received:
    0
    Thanks about your answer.

    So, there is no any ways that are compliant with both of them (TCC LE and CMD)?
    Is there any TCC LE settings that will help to go around with this?
     
  4. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    There is the CmdVariables .INI directive. If you put CmdVariables=Yes in your .INI file, somewhere in the [4NT] section, and restart, you can use variable names containing parentheses, spaces, and other problematic characters. But: you must use both a leading and a trailing percent sign, as in CMD.EXE. Note that this affects both environment variables and internal variables, breaking compatibility with the vast majority of Take Command (and 4NT, and 4DOS) batch files! I personally do not recommend this approach. In my personal opinion, it would be a lot easier just to copy that one problematic variable into another one.

    If you look at the top of this forum, you'll see a couple of 'pinned' threads. The first one covers compatibility directives.
     
  5. miXza-81

    Joined:
    Aug 10, 2015
    Messages:
    4
    Likes Received:
    0
    Ok.

    Thanks!
     
  6. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,804
    Likes Received:
    82
    Fixed in 14.00.02.
     
  7. miXza-81

    Joined:
    Aug 10, 2015
    Messages:
    4
    Likes Received:
    0
    So it seems. Thanks!
     
  8. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    That's certainly far preferable to the CmdVariables thing!

    Rex, are you special-casing just that one stupid variable name?
     
  9. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,804
    Likes Received:
    82
    Not at all. I'm special-casing *two* stupid variable names. (Something I did a couple of years ago in the full TCC / TCMD.)
     
  10. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    Any chance of a formal announcement, detailing the fixes? And I'm sure you're already aware that it doesn't run in XP, but that might be worth mentioning too.
     

Share This Page