"IF" command in a variable does not expand redirection variable name

Jul 31, 2010
5
0
#1
The script tcc_quirk.bat manages to create a file "%[CmdLog]" from the command %[Cmd] >& %[CmdLog] when the command (the Cmd variable) contains an IF statement. For example:
Code:
set Cmd=if not isdir \t\tcc mkdir \t\tcc
set CmdLog=\t\tcc\whatever.log
%[Cmd] >"%[CmdLog]"
.
The uploaded tcc_quirk.bat demonstrates the quirk (or my mistake ..).

Happens with TCC 17.00.58 x64 Windows 8.1 [Version 6.3.9600]
 

Attachments

Last edited: