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;
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;
c:\utils>MonthName.cmd 6
"delims= " was unexpected at this time.

When I run this from CMDebug, it works;

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?



Staff member
May 14, 2008
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.
Similar threads
Thread starter Title Forum Replies Date
T VIEW only works from command line Support 14
D Alias with setdos no longer works Support 21
Dmitry L. Kobyakov Fixed The SETARRAY /R command works incorrectly with cyrillic files Support 2
Joe Caverly .BAT works in TCC-RT 25, but not in TCC-RT 26 Support 4
Phileosophos Enumshares works sometimes Support 16
I findstr works in cmd but not in tcc Support 5
Dmitry L. Kobyakov WAD Start /pgm "name.htm" works improperly Support 4
Joe Caverly Works with CMD.EXE, no output with TCC.EXE Support 7
M "less" program that works in TC 18 Support 12
Joe Caverly Echo message works without the space? Support 3
cxxl dir /s works in mysterious ways :( Support 4
J WAD setarray "/f" only works on first one Support 1
M Console-Mode (*.exe) works in TCC, not in TCMD Support 2
redwdc btm won't run in ver. 17 but works in ver. 16 Support 11
I How to? Bat Works but BTM Doesn't Support 6
vefatica Alias works differenltly v16 vs. v17 Support 13
C FFind /w works but FFind /= doesn't? Support 2
R Drag to BTM no longer works in Windows 8.1 Support 10
Frank @replace works case sensitive Support 5
D TPIPE works without being in path, but not V; aemail Support 8
noahcoad c:/hello.txt works in cmd.exe but not tcc.exe Support 1
C .bat files works in cmd.exe, not in TCMD Support 6
K Ctrl-D alias no longer works Support 4
R %+ works differently after upgrade Support 3
Joe Caverly Clearing a section of the screen works in CMD, not in TC Support 2
old coot Problem with INS key flag in the debugger status bar Support 3
S Debugger keeps breaking with no break point set. Support 1
D Layout debugger windows Support 2
R Batch Debugger Command Expansion Window Support 3
S Debugger menu absent Support 10
MikeBaas Using the debugger Support 2
R Take Command Debugger v22 ENDCOMMENT not bolded Support 6
K Batch debugger not stepping correctly Support 4
S Output from debugger Support 4
S Problems with dir command in the debugger Support 5
S Debugger Bat file call history Support 9
T WAD Strange Unexpected "features" in the Debugger Support 2
BeechComer Debugger: how to set %1 variable? Support 3
D Chaining crashes the debugger Support 13
T Fixed V18 debugger crashed on save button Support 1
T Fixed V18 debugger crashed on stop button Support 2
Exolon V17 beta, debugger: STRG-S is inserting character instead of saving Support 12
MickeyF debugger keeps crashing Support 6
epement differences in IDE/debugger between v12 and v14 Support 1
Alan Strader Take Command IDE/Debugger has stopped working Support 5
newgeekorder Debugger IDE - strange tab and parameter behaviour Support 1
vefatica Debugger: popup _VARIABLE values Support 1
vefatica Another debugger observation Support 12
P Is there a way to examine arrays in the batch debugger? Support 1
vefatica Debugger now Unicode? Support 1

Similar threads