Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


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.

share|improve this question
up vote 5 down vote accepted

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

share|improve this answer
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 '12 at 20:07

You must log in to answer this question.

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