4

I'm working through troubleshooting a problem on my laptop, and I've noticed something odd - my COMSPEC environment variable has two values.

Output from typing SET at a command prompt:

ComSpec=%SystemRoot%\system32\cmd.exe;C:\Windows\SysWOW64\cmd.exe

Is this valid?

I've found a bunch of references like this one that seem to indicate that it should have only one value, but nothing definitive.

1 Answer 1

7

Nothing definitive, but to me it doesn't make sense and I would consider it an error. The purpose of the variable was to identity the command interpreter. (Emphasis mine). In the event of a user having several command interpreters, I would expect it to identity the default one.

Suppose you did have two entries in your comspec, what would you want to happen?

  1. The first one is used and the second is ignored. If so, then what is the point of the second one?

  2. It runs both shells. If so, then the logical consequence of this is that each routine is run twice which will certainly cause problems.

  3. It runs neither, which is also cause problems.

What I would suspect would happen is sometimes 1) and sometimes 3).

1
  • Thanks for the TechNet link - it backs up my belief that this environment variable should identify a single exe. Next step, identify how it got set that way!
    – Bevan
    Jul 9, 2012 at 20:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .