Solved

Simple build of a VS2012 solution using a batch file

Posted on 2013-11-11
1
888 Views
Last Modified: 2014-01-05
Hi Experts,

     I am trying to FINALLY automate our build process.  I am able to build our solution using the below command in a batch file:

devenv "C:\Projects\MySolution.sln" /build Release /out "C:\Build.Log"

How can I give the user (QA folks) running the batch file a simple pass/fail message instead of the lines of warnings and other messages?

I am looking for something like:

set success = devenv "C:\Projects\MySolution.sln" /build Release /out "C:\2012Build.Log"

if success < 0
(
      ECHO "Solution 'MySolution' failed to build.  Please check log file for details"
)
else
(
     set success = devenv "C:\Projects\MySolution2.sln" /build Release /out "C:\2012Build.Log"

     if success < 0
     (
           ECHO "Solution 'MySolution2' failed to build.  Please check log file for details"
     )
     else
     (
           ECHO "Build process has completed without any errors!"
     )
)

Thanks in advance!
0
Comment
Question by:axnst2
1 Comment
 
LVL 18

Accepted Solution

by:
Peter Hutchison earned 500 total points
ID: 39639212
Run devenv.com instead of devenv.exe and use the ERRORLEVEL in a IF statement to check whether it compiled ok.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to split this in C++ 4 78
WPF issue with Trigger 2 69
Not needed 13 58
regedit.exe REG ADD problems 2 17
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now