How do I resolve error MSB6006: "cmd.exe" exited with code 3?

golu kashyap picture golu kashyap · Jan 21, 2015 · Viewed 16.4k times · Source

I am getting the following error when building my code:

C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error      
MSB6006: "cmd.exe" exited with code 3.
Done executing task "CustomBuild" -- FAILED. (TaskId:40)

How do I resolve this?

Answer

Jonathan Mee picture Jonathan Mee · Jan 21, 2015

Open your .vcxproj file as a .xml file (so with Notepad++ or equivalent.)

You should be able to search the file for the "CustomBuild" tag.

Something in the task defined by that tag is failing.

You can test what it is by trying to run the commands in that task from the command line in the same directory as the .vcxproj.

If you can't solve your problem from there I'd recommend adding the "CustomBuild" task to the question so we can better help you.