Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

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)
 
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.
 
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.
 
I tried setting the full path SET COMSPEC=C:\Windows\system32\CMD.EXE. The behavior is the same: from time to time, TCC resets COMSPEC=<path>TCC.EXE.
 
It might be nice if START offered a way to modify the environment passed to the new process. Perhaps reading from a file, à la SET /R ?
 
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.
 
Back
Top
[FOX] Ultimate Translator
Translate