FTYPE in TCC, less quirky than in cmd.exe

Mar 18, 2010
I recently discovered yet another cmd.exe quirk which reminded me why I detest it so. It special-cases the FTYPE command, doing either limited or no % expansion on the line before processing it. This means that the same FTYPE ... %1 ... %* command entered into cmd.exe and TCC produce different results. Mind, I am not complaining or recommending a change -- I much prefer a consistent set of rules for processing command tails over the hardly-predictable cmd.exe approach.
Mar 18, 2010
Consider this common output from FTYPE:
batfile="%1" %*

If, with administrator permissions, you enter this in cmd.exe:
FTYPE batfile="%1" %*
, then that first output will remain unchanged. But if you had entered it into TCC.exe, you would get:
. This is because cmd.exe special-cases expansion (by not doing it) for the FTYPE command.
Aug 23, 2010
CMD has different rules for when expansion is unresolved. To remove doubt, always escape problematic characters.

Similar threads