Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 4 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.