Windows batch file: is there a way to add an "and"?

Posted by Beska on Stack Overflow See other posts from Stack Overflow or by Beska
Published on 2010-04-07T13:44:05Z Indexed on 2010/04/07 14:03 UTC
Read the original article Hit count: 181

Filed under:
|

The short version: is there a way to to write an "and" clause in a batch file?

The slightly longer version:

I've inherited a Visual Studio project that creates a dll and then copies that dll to another location. As a post build step, VS runs the following script.

if not '$(ConfigurationName)' == 'DebugNoSvc' goto end

xcopy /Y $(TargetDir)*.config $(ProjectDir)..\myService\bin\Debug
xcopy /Y $(TargetDir)*.config $(ProjectDir)..\myService\bin\DebugNoSvc

:end

It looks like there's a problem when the project is compiled as Debug, since it doesn't do the copy (I'm guessing that at some point the middle section got updated, but the if clause didn't.)

Is there an easy way to an "and" clause in batch?

© Stack Overflow or respective owner

Related posts about batch

Related posts about visual-studio