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

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
#1
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
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.
 

rconn

Administrator
Staff member
May 14, 2008
10,099
85
#3
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.
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).