How to use an OR statement in a Post-Build event?

post-build-event, visual-studio-2010

Solution

It seems like there is no provision for OR/AND in conditionals in Pre-Post Build events, at least according to its lack of documentation over here: http://technet.microsoft.com/en-us/library/bb490920.aspx

You would have to re-write your IF statement to do what you would want to do.

if not "$(ConfigurationName)" == "Debug" (
   rem do something
) else if not "$(ConfigurationName)" == "Release" (
   rem do the same thing as above
)

Hope that helps, though your conditions don't make sense to me. :-)

Problem

I am trying to use a conditional with an OR in a Post-Build event, but so far, I have had not luck. The following does not work: `if not "$(ConfigurationName)" == "Debug" or not "$(ConfigurationName)" == "Release" (` but this works: `if not "$(ConfigurationName)" == "Debug" (` With the first one, I get an exist code 4.

Original source