Here is a couple of TCC's incompatibilities with CMD.EXE I've discovered. To check any of them, create file Test.cmd, paste an example there, save Test.cmd and run it first under TCC.EXE then under CMD.EXE and compare outputs.
1. set aaa=c:\windows\
for %%a in (%aaa%nul) do echo %%~dpa
2. setlocal enabledelayedexpansion
set Prm1=Test
for /l %%a in (1,1,1) do (
echo !Prm%%a!
)
3. [supposing there is an empty folder "C:\Empty\1 1" with short name C:\EMPTY\110994~1]
if exist 110994~1\nul echo
4. setlocal enabledelayedexpansion
call :a c:\windows\
call :a c:\windows
exit /b
:a
set DirName=!%1!
echo %DirName:~-1%
5. verify other 2>nul
call :a && echo b
exit
:a
6. verify other 2>nul && (
echo 1
echo 2
)
7. [run Test.cmd with parameter ""]
set testString_=%1
echo %testString_%
8. setlocal enabledelayedexpansion
set s=123
for /L %%c in (0,1,255) do (
set si=!s:~%%c,1!
if defined si set charCount=%%c
)
echo %charCount%
9. set aaa="bbb"
if [^%aaa:~,1%] == [^"] echo ###
10. setlocal disableextensions
set a
1. set aaa=c:\windows\
for %%a in (%aaa%nul) do echo %%~dpa
2. setlocal enabledelayedexpansion
set Prm1=Test
for /l %%a in (1,1,1) do (
echo !Prm%%a!
)
3. [supposing there is an empty folder "C:\Empty\1 1" with short name C:\EMPTY\110994~1]
if exist 110994~1\nul echo
4. setlocal enabledelayedexpansion
call :a c:\windows\
call :a c:\windows
exit /b
:a
set DirName=!%1!
echo %DirName:~-1%
5. verify other 2>nul
call :a && echo b
exit
:a
6. verify other 2>nul && (
echo 1
echo 2
)
7. [run Test.cmd with parameter ""]
set testString_=%1
echo %testString_%
8. setlocal enabledelayedexpansion
set s=123
for /L %%c in (0,1,255) do (
set si=!s:~%%c,1!
if defined si set charCount=%%c
)
echo %charCount%
9. set aaa="bbb"
if [^%aaa:~,1%] == [^"] echo ###
10. setlocal disableextensions
set a