Works in debugger, not from cmd line

I'm using CMDebug v22.00.42 x64 on Microsoft Windows 7 64-bit [Version 6.1.7601]

MonthName.cmd is as follows;
Code:
c:\utils>type monthname.cmd
@for /f "tokens=%1" "delims= " %%G in ('echo Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec') do echo %%G

When I run this from cmd.exe, it does not work, and it is not supposed to work;
Code:
c:\utils>MonthName.cmd 6
"delims= " was unexpected at this time.

When I run this from CMDebug, it works;
1529834294295.png


Under Options, I have CMD Syntax selected.

If I change the line to read "tokens=%1 delims= ", which is the correct syntax, it works both from cmd.exe and CMDebugger.

With CMD Syntax selected, why does the incorrect syntax work from CMDebugger, when it should not?

Joe
 

rconn

Administrator
Staff member
May 14, 2008
12,161
140
When you run a batch file in CMDebug, it's actually executing TCC-RT. Selecting CMD syntax sets some internal TCC flags (duplicate CMD bugs, require trailing %'s for variables, only recognize the CMD subset of internal commands, etc.). It doesn't try to dumb down every TCC enhancement for those CMD commands.