Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

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

Aug
4
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.


tccleerror.png
 
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)]
 
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?
 
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.
 
That's certainly far preferable to the CmdVariables thing!

Rex, are you special-casing just that one stupid variable name?
 
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.
 

Similar threads

Back
Top