在用VS2008编译C++程序的时候发现以下错误:

error PRJ0003  生成 cmd.exe 时出错

其实意思就是找不到cmd.exe,我觉得,其原因是VS2008里的有些环境变量设置不对或者没有设置。

在下面的位置设置:

tools=> Options => Projects and Solutions -> VC++ Directories page 
环境变量
$(SystemRoot)/System32
$(SystemRoot)
$(SystemRoot)/System32/wbem 

就可以了。