0
votes

In VS2012. I just set prebuild event as following.

md "$(TargetDir)Strings"

It works fine first time and creates the directory. After that. When ever I am building it is showing error :

Error 1 error MSB3073: The command "md "C:\FIT\Tech\Programmer365\Projects\SDR\Debug\Strings" :VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets 124 5 SDR-UI

Any help appreciated.

1

1 Answers

0
votes

Once you created the directory, trying to create it again will fail. MSBuild can't really distinguish that it failed because the directory already exists (as opposed to you not being able to write to the location or similar), so the build fails.

You need a conditional creation of the directory. Have a look here to see how this can be done: Create folder with batch but only if it doesn't already exist