Version 5 of COMSPEC

Updated 2008-11-06 13:55:09 by Duoas

[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.