Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Is there a difference between %comspec% and "cmd"

30 Sep 2011   #1
skew

Windows 7 64bit
 
 
Is there a difference between %comspec% and "cmd"

I just noticed that the result of typing "cmd" and "%comspec%" in the command prompt ends with the exact same behavior. Aside from the fact that "cmd" is a command and "%comspec%" an environment variable, there must be a suitable usage when "cmd" is preferred over "%comspec%".

Are there subtle differences? When should I use what?


My System SpecsSystem Spec
.
30 Sep 2011   #2
Barman58

Windows 10 Pro x64 x2 Windows 10 Enterprise x64, Ubuntu
 
 

%comspec% is a system variable that simply points to cmd.exe so typing either runs cmd.exe. the reason it is there is to allow better programming access to the cmd.exe program, if you need to move the location of the cmd program then a simple change of the variable should allow correctly written applications to continue to work. It also allows you to replace cmd.exe with another program for special purposes.

These variables have been around since the early days of windows and as long as programmers use them a lot of the incompatibilities seen in programs which do not work with upgraded operating systems would not occur
My System SpecsSystem Spec
Reply

 Is there a difference between %comspec% and "cmd"




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Confused Between The Difference - "My Documents" & "Documents"-Win7?
Hello. I have been very curious for a while now and somewhat confused. This is regarding Windows 7, so if you are not using Windows 7 you may not know what I am talking about. Okay, I see in Windows 7 you have a folder called "Documents" in your start menu and when you open it, you have the...
General Discussion
"Include a system image of drives" what difference does it make?
i'm about to create my very 1st backup for windows on c:\ and, if possible, also a recovery option for Programme on d:\ please explain me someone what will happen/not happen to my backup files if the last chekbox is checked when i start to backup? i'm asking for a good advise as well. should i...
Backup and Restore
"Superspeed USB" and "USB 3.0" - What's the difference ?
The heading states my question. When USB 2.0 was upgraded , the upgraded product seemed to be referred to exclusively as "USB 3.0". Now I see references everywhere to "Superspeed USB" . Is this merely a commercial name for the same animal or is it a different product altogether ?
General Discussion
What is the difference between "image" and "backup"
What is the difference between "image" and "backup"? Thank you!
Backup and Restore
Install time difference between "Upgrade" and "Custom"
Is the time to "Upgrade from vista to 7 supposed to be wayyy longer then it would to do jsut a clean install? (For example, hanging at 18% for a while while installing during upgrade) (posting this since i cant get any replies to a previous topic)
Installation & Setup


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 13:17.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App