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

WAD Apparently a bug when expanding environment variable %ProgramFiles(x86)

Discussion in 'Support' started by rfaquino, Feb 7, 2013.

  1. rfaquino

    Oct 17, 2008
    Likes Received:
    There seems to be a bug on Take Command/TCC when expanding the environment variable %ProgramFiles(x86). While Windows Command Prompt correctly expands it to:
    "C:\Program Files (x86)" (in my system), Take Command/TCC removed the space between "Files" and "(x86)", thus rendering an invalid directory name on 64-Bit Windows systems. Please see screens below.

    I am running Windows 7 Ultimate SP1.

    Take Command.jpg Command Prompt.jpg
  2. Steve Fabian

    May 20, 2008
    Likes Received:
    This issue has been previously reported, and - IIRC - is caused by Win7 using invalid syntax (i.e., one that cannot be used in earlier versions of MS Windows) for the name of the environment variable - to wit, the parentheses. Use either %@shfolder[42] or %[ProgramFiles(x86)] - both work correctly. Search this forum to locate the older thread.
  3. rconn

    rconn Administrator
    Staff Member

    May 14, 2008
    Likes Received:
    TCC didn't remove the space, it expanded "ProgramFiles" and appended the (non-variable-name) "(x86)" to the end.

    Since TCC supports a single leading % (CMD doesn't, except sometimes in FOR) it has to break when it thinks the next character isn't likely to be part of a variable name. If you want the CMD behavior of requiring enclosing %'s around a variable, you can set "CMDVariables=Yes" in your TCMD.INI initialization file (in the "[4NT]" section).

Share This Page