Visual Studio Development Bookmark and Share   
 index > Installing and Registering Visual Studio Express Editions > Error spawning 'cmd.exe'
 

Error spawning 'cmd.exe'

  When I compiled the project, there was an error,----Error spawning 'cmd.exe'.

  Why ?

mouxaifeong  Sunday, December 18, 2005 6:08 AM

CMD.exe should have been found in your path.

I'm running into the same problem, but i've also found that system commands like ipconfig.exe won't run unless I'm in the system32 folder.

I'd say this is indicative of a bigger problem, potentially with path expansion.

I found that on my machine, the regvalue HKLM\SYSTEM\CurrentControlSet\control\Session Manager\environment\path was set as a REG_SZ instead of a REG_EXPAND_SZ, and my path included environment variables.

I suspect this occured when I installed NVideo Dev tools, as they were the last entry in my path string.

the solution is to create a new Expandable string called "PathX", copy the path value string into it, then delete the old path value and rename "PathX" to "Path" and reboot.

Fixed all my problems.

Jaeger Mitchell  Thursday, January 26, 2006 9:19 PM
I am also getting this error constantly.  Nothing in this forum (searching on this error) suggests an answer.  Help!!
Cat Herder  Saturday, January 07, 2006 3:35 PM

Hi all,

I've got the same problem and i've found this solution...

In the Options go into Projects and Solutions -> VC++ Directories page and place this rows:

$(SystemRoot)\System32
$(SystemRoot)
$(SystemRoot)\System32\wbem

Bye

  • Proposed As Answer bystegosaurus1 Monday, April 20, 2009 2:27 AM
  •  
MagicPN  Sunday, January 08, 2006 1:30 PM
The "SystemRoot" commands seemed to do it.  No further problems yet with differing programs.
Cat Herder  Tuesday, January 10, 2006 12:09 PM

CMD.exe should have been found in your path.

I'm running into the same problem, but i've also found that system commands like ipconfig.exe won't run unless I'm in the system32 folder.

I'd say this is indicative of a bigger problem, potentially with path expansion.

I found that on my machine, the regvalue HKLM\SYSTEM\CurrentControlSet\control\Session Manager\environment\path was set as a REG_SZ instead of a REG_EXPAND_SZ, and my path included environment variables.

I suspect this occured when I installed NVideo Dev tools, as they were the last entry in my path string.

the solution is to create a new Expandable string called "PathX", copy the path value string into it, then delete the old path value and rename "PathX" to "Path" and reboot.

Fixed all my problems.

Jaeger Mitchell  Thursday, January 26, 2006 9:19 PM
Im getting the same problem, i tried using the
$(SystemRoot)\System32
$(SystemRoot)
$(SystemRoot)\System32\wbem

it didtn work for me :( any suggestions?


  • Proposed As Answer byAyyavu P Monday, October 05, 2009 11:29 AM
  •  
ThrasherNYC  Wednesday, August 02, 2006 4:48 PM
Try using the solution I posted previously
Jaeger Mitchell  Wednesday, August 02, 2006 8:45 PM
The fix from Jaeger worked for me. No restart was required though.
X-Tatic  Tuesday, October 24, 2006 10:31 AM
I tried Jaeger Mitchell's method of fixing, with no luck. Any ideas out there folks?
redevil  Tuesday, November 14, 2006 4:40 PM
Thank you MagicPN, your "trick" worked for me either
trobin  Monday, April 30, 2007 3:38 PM
I'm getting this same problem too.
Because I have the Professional version of VS 2005, maybe this is not the right forum to post, but my problem is that I can't find the following:
Projects and Solutions -> VC++ Directories page

This option is only in the express version?

Projects and Solutions are there, but not the directories area.
Is there somewhere else that I can enter this data?
Or is there another solution to getting past this error? -- It seems to happen at the end of the build when it tries to embed the manifest information.

Thanks
slender_bamboo  Tuesday, August 28, 2007 9:08 PM

Same here ... Maby this help ... earlier I hadnt probs and it happening after installed sdk 1- needed for some apps.
introne  Saturday, December 22, 2007 6:27 AM

For Visual Studio 2008, it's tools->option->Project and Soltuions->VC++ Directories

j.hu_sbcglobal.net  Saturday, December 22, 2007 5:36 PM
Thanks !!! The solution given by MagicPIN worked for me !!
Piyush Soni  Thursday, January 24, 2008 12:59 AM
This solution did not work for me I am still getting this error out of both 2008 express and the 2005 studio. Any alternative or further discussion?
Wintersrush  Sunday, March 30, 2008 9:27 PM
ThrasherNYC's soggestions works on VS 2008 !
YonatanBetzer1  Thursday, April 10, 2008 8:45 AM
I encountered this problem after installing Studio Plug Ins for xUnit and NUnit and searched for several hours to find the real answer. In my case the Registry setting type was changed in the Studio's path environment. Open the Studio Command Window and try to use cmd, then try cmd in the new window and it will fail. This confirms the path is hosed in the Studio environment.
I copied this from another post somewhere:
...a bigger problem, potentially with path expansion.I found that on my machine, the regvalue HKLM\SYSTEM\CurrentControlSet\control\Session Manager\environment\path was set as a REG_SZ instead of a REG_EXPAND_SZ, and my path included environment variables.
I suspect this occured when I installed NVideo Dev tools, as they were the last entry in my path string.

The solution is to create a new Reg Entry Expandable string called "PathX", copy the "Path" value string into it, then delete the old path value and rename "PathX" to "Path" and reboot.Fixed all my problems.

Fixed my problems too.
fredccc  Wednesday, July 23, 2008 3:26 PM

Thanks man..

The solution works..

cipher18  Wednesday, October 08, 2008 8:01 PM
Thanks. It worked for me!!
MISKSH  Wednesday, November 05, 2008 2:40 AM
Thanks MagicPN. I just used a text editor on 'VCComponents.dat' and added the files to the 'Path Dirs' line.

Worked ok!
stegosaurus1  Monday, April 20, 2009 2:28 AM

I am new to this discussion...

I got similar problem...

Thnks....MagicPN and others.

adding the paths......
$(SystemRoot)\System32
$(SystemRoot)
$(SystemRoot)\System32\wbem


it worked for me.


Vasu
vasu.vlsi  Tuesday, June 23, 2009 4:30 AM
Thank You very much Jaeger Mitchell ...it s working after made registry changes.
Ram Raj  Friday, August 07, 2009 5:04 AM
Im getting the same problem, i tried using the
$(SystemRoot)\System32
$(SystemRoot)
$(SystemRoot)\System32\wbem

it didtn work for me :( any suggestions?



Thank you.MagicPN
Awesome!!!
LiveICE  Tuesday, September 08, 2009 3:33 AM
This worked for me. Follow this link: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=98658

Workaround: Placing a physical copy of cmd.exe in the VC\Bin directory appears to resolve this problem.

1. Copy cmd.exe from C:\WINDOWS\System32\cmd.exe

2. Paste at C:\Program Files\Microsoft Visual Studio 8\VC\bin, or the appropriate installation folder on your system.
  • Proposed As Answer byMMAli Monday, October 05, 2009 3:31 PM
  •  
MMAli  Monday, October 05, 2009 3:30 PM

You can use google to search for other answers

Custom Search

More Threads

• Installer problem
• Error when opening a project in Visual Studio Express 2005
• Changed data saved, however old data retrieved.
• Free Books with registration of Visual Web Developer
• People please help, can't use Visual Basic 2005 Express Edition!!!
• Menu mixup???...
• Re:ODBC32
• How to still use Visual Basic 2008 Express Edition after expired
• MFC in VC++ express beta 2
• New to Visual Basic and Hungry!!!