COMSPEC constantly reset to TCC.EXE

The context: I run a software that lauches Perl>CMD>make>CMD>CL at a very fast pace. If COMSPEC=<path>\TCC.EXE, TCC gets launched instead of CMD, but this regularly hangs (I would say launching many TCC processes at the same time triggers some problems with some ressources).
What I do: set COMSPEC=CMD.EXE. I also have added %COMSPEC in PROMPT in order to see the value of COMSPEC at any time.
The problem: COMSPEC is regularly reset to <path>\TCC.EXE, as I can see with the PROMPT and with ProcessExplorer.
TCC 28.01.14 (but I also had the issue with TCC 27)
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
If you are running TCC, that is the COMSPEC. You would need to run CMD to have the COMPSEC set to CMD.
Do you run your software from a script or some other way? If from a script, you could do CMD /c scriptname to run it.
 
May 20, 2008
11,423
99
Syracuse, NY, USA
If you SET COMSPEC=C:\WINDOWS\SYSTEM32\CMD.EXE in your TCSTART file you should have it in all instances of TCC. I don't know if that will screw up TCC; I don't know if TCC itself relies on the value of COMSPEC.
 
May 20, 2008
11,423
99
Syracuse, NY, USA
I've had an unqualified SET COMSPEC=C:\Windows\System32\cmd.exe in _TCSTART for a couple days now and I don't see TCC changing it. I can't imagine when, other than startup, TCC would set COMSPEC. And that value is inherited by apps started with START.

In the system environment is ComSpec=%SystemRoot%\system32\cmd.exe. I'm not sure why TCC changes it; that may go back to MSDOS/4DOS days. While there may be other uses for the COMSPEC environment variable, the C function "system()" uses it and I'd bet that's what PERL is doing. These days, any program using it is probably expecting it to locate CMD.EXE.
 

Similar threads