CMD if parsing

in "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" there are lines like this

:Parse_Args
IF /I "%~1"=="/debug" SET "Configuration=Debug" & SHIFT & GOTO Parse_Args
IF /I "%~1"=="/release" SET "Configuration=Release" & SHIFT & GOTO Parse_Args

It seems under CMD the SHIFT and the GOTO are part of the IF clause.
Under TCC the &-command-separator makes that the SHIFT and GOTO always apply — yielding and infinite loop.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,461
88
Albuquerque, NM
prospero.unm.edu
Type OPTION and press Enter to open the configuration dialog. On the first tab (Startup), the second item down in the last column is labelled 'Duplicate CMD.EXE bugs'. Try turning it on -- I think that's what you want.
 
Type OPTION and press Enter to open the configuration dialog. On the first tab (Startup), the second item down in the last column is labelled 'Duplicate CMD.EXE bugs'. Try turning it on -- I think that's what you want.

You are right. Thanks. (I should have found this answer myself: I knew the option but never looked at what bugs are replicated.)
 
Similar threads
Thread starter Title Forum Replies Date
M Command line parsing differences between cmd.exe and TCC Support 6
T WAD CMD incompatibility Support 14
sully9 How to? Unexpected %DATE% CMD variable format (vs DATE /T format) in CMDebug Support 1
L FTYPE in TCC, less quirky than in cmd.exe Support 3
Peter Murschall Single-line Do-CMD is a bit uncooperative. Support 6
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
T Date format date different from cmd Support 7
D Differences between TCC and CMD with COPY /b Support 4
M Oracle batch OPatch.bat.bat not working in TCC but correctly in CMD Support 5
E TCC/CMD difference Support 5
S How to? Deinstalling TC/reinstating execution of bat files by cmd in Win7 Support 31
D How to? Pass OpenHere Folder to CMD? Support 6
R Difference between TCC and CMD: variable names with hyphens Support 4
M WAD "Pictures" directory is empty in TCC but not in CMD or Explorer Support 4
rps Cmd history recall Support 4
rps Documentation TITLE cmd docs Support 0
Joe Caverly PUSHD with UNC path in CMD.EXE Support 2
W Starting program for word to pdf conversion (difference cmd and tcc) Support 13
Joe Caverly Using this CMD technique from TCC Support 17
W If command - different with CMD Support 6
I how to make TCC default/replace cmd.exe? Support 9
R FOR usage error from TCC but not from CMD Support 16
I findstr works in cmd but not in tcc Support 5
D Pasting Unicode data has different behavior on TCC and CMD Support 2
Joe Caverly Works with CMD.EXE, no output with TCC.EXE Support 7
Joe Caverly tcommand(cmd) Support 13
L WAD ECHO. expansion of non-existent env-vars differs from CMD.exe Support 6
Joe Caverly "Functions" in cmd.exe batch files Support 6
Joe Caverly Works in debugger, not from cmd line Support 1
K CMD, TCC, VisualStudio 2017, VcVars* differences Support 1
D Does TCC improve CMD's implementation of ECHO? Support 6
P Labels in batch files: TCC vs CMD.exe Support 9
Patulus Yet another thread on CMD compatibility Support 16
A Fixed (CMD compat) START /D fails to recognize the switch option. Support 3
Joe Caverly CMD.EXE and filename(1).ext Support 3
H DOS CMD Sort+Add Sequence+Remove Sequence number Support 12
T WAD Difference between TCC and CMD in handling multi-command lines Support 6
C Nested IF syntax — TCC behaving differently to CMD Support 12
T CMD incompatibility Support 14
V Network share slowness vs CMD? Support 19
P Fixed Rexx .cmd files no longer work in TCC 20 Support 3
TT's Help! Uninstalling TCC did not restore cmd.exe as Win10 default batch file processor. Support 4
R How to? Display text same as in CMD Support 14
E How to? use Executable Extensions: .bat and .cmd Support 8
D Tab completion differences with cmd.exe Support 3
deleyd Fixed Behavior different than CMD Support 1
vefatica START, CMD vs. TCC Support 0
R Difference in behavior of RMDIR vs. CMD.EXE? Support 5
jogi Problem with FOR statement in TCC but not M$ CMD Support 1
C Documentation .CMD .BAT .BTM Support 15

Similar threads