Saturday, 30 September 2017

windows - Is it valid for %Comspec% to have multiple entries?


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.



Answer



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


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...