BATCH - What is the easiest way to reset ERRORLEVEL to zero?

I have a post-build event that runs some commands for a c# project. The last command would sometimes cause the ERRORLEVEL value not equils to zero and then the build fails.

I want to append an extra line of command to always set the ERRORLEVEL value to zero. What is the most convenient way to do that?

This question and answers originated from www.stackoverflow.com
Question by (7/11/2009 1:31:36 PM)

Answer

I found that "exit 0" looks like a good way to deal with this problem.

Answer by

Find More Answers
Related Topics  batch  ms-dos  postbuild-event  prebuild  errorlevel
Related Questions
  • WMCI - how to get the ERRORLEVEL

    I want to use the "wmic" command for finding out if a specific java process is still up and running. E.g.> wmic process where "commandLine like '%ACTMonitor%' and executablePath like '%PATH1%' an…
  • How to set ERRORLEVEL in SSIS?

    I have a batch file that runs an SSIS job. I have no knowledge of how the SSIS job runs, I took over a project involving it. The batch file uses %ERRORLEVEL% to detect errors that occur within t…
  • Detecting if a file is open in a batch file

    Say I have a batch file for carrying out a long build and at the end it creates an EXE. If I forget to close the app down before I start the build, the link phase fails when it can't re-create the E…
  • Handling nmake errorlevel/return codes

    I have an nmake-based project which in turn calls the asp compiler, which can throw an error, which nmake seems to recognize: NMAKE : fatal error U1077: 'C:\Windows\Microsoft.NET\Framework\v2.0.5…
  • What is the easiest way to capture the Keyboard.KeyDown event in .net

    I am developing a Windows Console application in .Net 4.0 C# that analyzes typing patterns. I've added the PresentationCore reference to gain access to System.Windows.Input.Keyboard object. I …
  • ERRORLEVEL inside IF

    Just stumbled into a weird thing with %ERRORLEVEL% and wanted to see if anyone knows why and if there's a way to fix it. Essentially, it seems as if commands executed inside if statements don't set …
  • Batch ERRORLEVEL results different from CMD?

    Why does ERRORLEVEL behave differently in these two circumstances? From the command line: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\>aescrypt.exe -…
  • Is there way to pass the percentage (%) to routine?

    dos-batch file The input file has three records: HOW NOW BROWN COW JACK AND JILL 100% JUST YOU & ME Script is as follows: @echo off set infile=e:\file.txt set outfile=e:\outfi…
  • TortoiseSVN from the command line and "IF ERRORLEVEL"?

    I have a batch file I'm running from a Windows XP w/service pack 3 workstation which applies SQL changes to a database using sqlcmd.exe in SQL 2005. I've got a command-line entry for TortoiseSVN …
  • Is there a reference to all Windows "errorlevel" by command?

    Is there a reference to all Windows "errorlevel" by command? Looking for a page that defines all error levels, by command.