Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Simple build of a VS2012 solution using a batch file

Posted on 2013-11-11
1
917 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 19

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

856 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