COMSPEC
ComSpec, officially referred to as the COMSPEC environment variable, designates the path to the command-line interpreter on Windows and DOS systems. It is used by the operating system and many applications to locate the program that should be used to run command-line processes. COMSPEC is inherited by child processes, enabling scripts and utilities to spawn a shell without hardcoding a specific executable.
In modern Windows installations based on the Windows NT lineage, COMSPEC typically points to the command processor
The variable is commonly accessed by users and software to determine how to invoke a command shell.
Although altering COMSPEC is possible through system environment settings, changing it can affect scripts, installers, and