If the COMSPEC is set to an absolute path, use it instead of just cmd.exe. This avoids searching for the tool in the current working directory and the PATH. If COMSPEC is not set to an absolute path, fall back to the existing behavior.
cmd.exe
PATH
Issue: #18350 Topic-rename: ninja-cmd