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

SignUp Now!

FTYPE in TCC, less quirky than in cmd.exe

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.
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.
CMD has different rules for when expansion is unresolved. To remove doubt, always escape problematic characters.

Similar threads