CMD incompatibility

May 20, 2008
473
2
I'm trying to run the vcvarsall.bat from VS2015 update 3 to include the Windows SDK version 10.0.14393.0. Unfortunately, the batch file does not work correctly under TCC. I get this:
Code:
vcvarsall.bat amd64 10.0.14393.0
!ERROR! Windows SDK 10.0.14393.0 : 'C:\Program Files (x86)\Windows Kits\10\inclu
de\10.0.14393.0\um'
This appear to be related to something in
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vcvarsqueryregistry.bat.
Around line 88, it has this block of code:
Code:
@setlocal enableDelayedExpansion
@if not "%WindowsSdkDir%"=="" @for /f %%i IN ('dir "%WindowsSdkDir%include\" /b /ad-h /on') DO (
    @REM Skip if Windows.h is not found in %%i\um.  This would indicate that only the UCRT MSIs were
    @REM installed for this Windows SDK version.
    @if EXIST "%WindowsSdkDir%include\%%i\um\Windows.h" (
        @set result=%%i
        @if "!result:~0,3!"=="10." (
            @set SDK=!result!
            @if "!result!"=="%user_inputversion%" set findSDK=1
        )
    )
)
Since the DIR command appears to be working, I suspect the issue is something related to the enabledDelayedExpansion parameter to setlocal, but that's as far as I have gotten.

When I run it under CMD, it works just fine.

Code:
TCC  20.11.40 x64   Windows 10 [Version 6.3.14393]
TCC Build 40   Windows 10 Build 14393
 
May 20, 2008
473
2
If you're referring to the environment variable, that is set from the default environment.
Code:
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
 
Aug 3, 2016
376
9
Netherlands
Ok, seems to be another problem, then. There was also a mention of enabling delayed expansion in TCMD.ini (through the OPTION command) IIRC. That is as far as I can help (no experience with Visual Studio).
 
May 20, 2008
473
2
I think, in this case, there are parameters in the SETLOCAL of CMD that are not supported in TCC. There may be additional things, but that was the most apparent.
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
I'm trying to run the vcvarsall.bat from VS2015 update 3 to include the Windows SDK version 10.0.14393.0. Unfortunately, the batch file does not work correctly under TCC. I get this:
Code:
vcvarsall.bat amd64 10.0.14393.0
!ERROR! Windows SDK 10.0.14393.0 : 'C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\um'

Not reproducible here (and I run VCVARSALL several times a day, every day).

SETLOCAL in TCC does support the "EnableDelayedExpansion" variable (as well as "DisableDelayedExpansion, EnableExtensions, and DisableExtensions). They are not documented in the TCMD help because TCC doesn't need them.

I suspect the issue is more likely in your TCMD.INI.[/QUOTE]
 
May 20, 2008
473
2
This is with a fresh install in a brand new VM. So, no pre-existing cruft hanging around to corrupt the INI. I don't recall changing too much from the INI defaults, insert mode, complete hidden, add \ to directories, and hiding a bunch of stuff in the UI.
 
May 20, 2008
473
2
It's no longer causing the error for me now either. My TCC/TCMD are unchanged. I did install an older SDK version for a project, though that's not the one that is set when I run vsvarsall x64 and let it default the SDK. But, no error. Strange.
 
Jun 5, 2015
12
0
Same issue here. I'm using
TCC LE 14.00.9 x64 Windows 10 [Version 6.3.14393]
TCC LE Build 9 Windows 10 Build 14393

the vcvarsall.bat includes this loop:
for /F "tokens=1,* delims= " %%a in ("%__VCVARSALL_ARGS_LIST%") do (
if "%VSCMD_DEBUG%" GEQ "2" (
@echo [DEBUG:%~nx0] inner argument {%%a}
)
call :parse_argument %%a
set "__VCVARSALL_ARGS_LIST=%%b"
goto :parse_loop
)​

which seems to work fine in CMD but not in TCC.

Testing with a reduced version test.bat, with just the following 4 lines:
set __VCVARSALL_ARGS_LIST=amd64
for /F "tokens=1,* delims= " %%a in ("%__VCVARSALL_ARGS_LIST%") do (
echo %%a
)
this works fine in TCC too and prints "amd64", but this one
set __VCVARSALL_ARGS_LIST=amd64
for /F "tokens=1,* delims= " %%a in ("%__VCVARSALL_ARGS_LIST%") do (
if "%VSCMD_DEBUG%" GEQ "2" (
@echo [DEBUG:%~nx0] inner argument {%%a}
)
echo %%a
)​
doesn't work and prints nothing. So it seems that that "if" inside "for" is causing some issue. Am I missing some ini setting to make it work?

This doesn't seem to be the only issue, however it is possible the cause of the other issues is the same.
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
but this one
set __VCVARSALL_ARGS_LIST=amd64
for /F "tokens=1,* delims= " %%a in ("%__VCVARSALL_ARGS_LIST%") do (
if "%VSCMD_DEBUG%" GEQ "2" (
@echo [DEBUG:%~nx0] inner argument {%%a}
)
echo %%a
)​
doesn't work and prints nothing. So it seems that that "if" inside "for" is causing some issue. Am I missing some ini setting to make it work?

That snippet works fine in TCC v21 (as does the entire vcvarsall.bat).
 
Jun 5, 2015
12
0
Good, I double checked and with TCC v21 it always works fine (both with my ini file and default options), while with TCC/LE v14 it never works fine (either with my ini file or default options).
So, it seems a TCC/LE v14 bug.
 
Sep 24, 2018
1
0
You can comment out the if and it will work I guess the echo will expand things correctly
@REM TCC LE expansion different MJC
@REM if "%VSCMD_DEBUG%" GEQ "2" (
@echo [DEBUG:%~nx0] inner argument {%%a}
@REM )
call :parse_argument %%a
 
Similar threads
Thread starter Title Forum Replies Date
T WAD CMD incompatibility Support 14
samintz A new CMD incompatibility Support 5
J Happy CMD/TCC incompatibility Support 0
L How to synthesize cmd.exe's DEL /Q Support 2
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
M Command line parsing differences between cmd.exe and TCC Support 6
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
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

Similar threads