Unsupported CMD statement idiom in TCC/LE

Nov 25, 2010
2
0
#1
Hi,

In my build procedure I have a batch file that calls another batch file with the following statement

Code:
echo | gendb.bat 5.1.1.0
as a form to continue dumping to the console the statements inside gendb.bat

While this idiom works using the normal W7 CMD, it doesn't using TCE LE 12,00,37 - you just get a TCC: Unknown command "gendb.bat" error.

In fact, I have even double-checked and that statement won't work even directly from command line (so it's not a batch-inside-batch limitation). I have obviously made triple sure that "gendb.bat" does exist in the directory and that it runs fine if you just call it without the preceding echo.

I am pretty sure this used to work on an older TCC/LE version... or maybe someone modified the batch file recently.

Can anyone confirm if this happens to them and if it is a regression problem?

Thanks!
 

rconn

Administrator
Staff member
May 14, 2008
10,551
97
#2
Hi,

In my build procedure I have a batch file that calls another batch file with the following statement

Code:
echo | gendb.bat 5.1.1.0
as a form to continue dumping to the console the statements inside gendb.bat
Hmm - in 25 years of writing command processors, I have *never* seen a construct like this. I can't imagine what its purpose is, though I can say that what will do is assign all STDIN in the batch file to read from the STDOUT of the ECHO statement.

While this idiom works using the normal W7 CMD, it doesn't using TCE LE 12,00,37 - you just get a TCC: Unknown command "gendb.bat" error.

In fact, I have even double-checked and that statement won't work even directly from command line (so it's not a batch-inside-batch limitation). I have obviously made triple sure that "gendb.bat" does exist in the directory and that it runs fine if you just call it without the preceding echo.
Regardless of the purpose, the error doesn't have anything to do with the strange construct. That error only has three possible causes: either the file is not really in the directory you think it is, or you're not really in the directory you think you are, or you've disabled the .bat extension (i.e., with PATHEXT).

When you pipe to a batch file, you cause TCC/LE to invoke another copy of itself as the child of the pipe. If you have done something like put a CD or CDD in your TCSTART.BTM, the child TCC/LE pipe process that tries to run the batch file will not be able to find it.
 
Nov 25, 2010
2
0
#3
When you pipe to a batch file, you cause TCC/LE to invoke another copy of itself as the child of the pipe. If you have done something like put a CD or CDD in your TCSTART.BTM, the child TCC/LE pipe process that tries to run the batch file will not be able to find it.
You were absolutely and utterly right! :D I did have a CD on my TCSTART.BAT and, in face of what you say, the new tcc would be running on that other dir. I had no idea that the pipe would spawn another TCC (which stands to reason, runs TCSTART.BAT on start). I moved the CD to a diff BAT that gets explicitly run by my specific shortcut and it's working beautifully! :p

It's inspiring to see people who know their stuff troubleshoot - many, many thanks!