Visual Studio Post Build Event MT.exe command fails with code 9009

Anand picture Anand · Jan 13, 2011 · Viewed 26.4k times · Source

Hi I am running following command from my post build event:

C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe -manifest "$(ProjectDir)$(TargetName).exe.manifest" -updateresource:"$(TargetDir)$(TargetName).exe;#1"

It is failing with Exited with code 9009... I don't understand why this happens; any suggestions?

Answer

jqa picture jqa · Feb 1, 2011

Try adding quotes around the mt.exe path, e.g.:

"C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe"

Also, make sure that path is valid.

Hope this helps. I've been beating my head against code 9009 all day and a full quoted path seem to make it work.