COMSPEC

[What is the purpose of this Windows environment variable and how does it impact Tcl?]

MHo: COMSPEC holds the path to the current command processor (command shell), which is something like c:\windows\system32\cmd.exe on modern windows versions. On Windows 9.x, the command shell is command.com instead of cmd.exe, which is a relict from 16 bit-MSDOS-days (still present for compatibility reasons). Programs could (and should) shell/exec to env(comspec) instead guessing what the command processor is ;-) I don't know how this environment variable is used by tcl internally...

Duoas The COMSPEC environment variable is used by the auto_execok command to find the command shell on Windows systems.

This environment variable can be found on other systems with varying levels of Windows emulation, but unless $tcl_platform(platform) eq {windows} it is not used, and is not guaranteed to be entirely uppercase. See the ~/lib/tclX.Y/init.tcl startup script for details.

Oh yeah, almost forgot: Since Windows NT command.com is essentially an alias for cmd.exe. In any case, always use auto_execok to start a shell program. :-) MHo No, as far as I know command.com is not an alias for cmd.exe, but something different as described above. command.com lacks, e.g. all of the newer features and commands of cmd.exe.