views:

1178

answers:

6

Hi

i have create a simple vc++ console application and try to print "Hello World".i am using windows server2003 machine

when i try to build this proj i got the error as Error: spawning cmd.exe how to resolve this one

Thanks in advance.

A: 

Are you running on Vista? Could this be a case of needing to run Visual Studio as Administrator?

Peter Mourfield
+5  A: 

Check if cmd.exe is in <Path> environment variable?

I just did a small test by removing the %SystemRoot%\system32 from path environment variable and I got the same problem what you are facing.

Error 4 Error spawning 'cmd.exe'. Project SEH

If it is the path issue then try adding below to Projects and Solutions -> VC++ Directories:

$(SystemRoot)\System32

aJ
thanks aj for ur support
Cute
A: 

I believe cmd.exe is not runnable by a non administrative user by default on Windows Server 2003, so I would check its permissions. That of course assumes you are not running it as Administrator already.

Jeremy
A: 

yes i hav found where the proble. I unable to locate path of cmd.exe so go to visualstudio tools->options->projects and ->vc++ directories and specify ($SystemRoot)/system32 then it working fine.

Cute
Good. Hope the answers given in this page helped you.
aJ
A: 

Yep. (Another weird windows error) Projects and Solutions -> VC++ Directories -> Executable Files Add $(SystemRoot)\System32 it works

reddy