delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/28/07:15:47

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ERRORLEVEL
Date: 28 Apr 2000 11:13:43 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 22
Message-ID: <8ebrp7$96b$1@nets3.rz.RWTH-Aachen.DE>
References: <3 DOT 0 DOT 6 DOT 16 DOT 20000428113818 DOT 2d8f76ac AT mail DOT cybercable DOT fr>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 956920423 9419 137.226.32.75 (28 Apr 2000 11:13:43 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 28 Apr 2000 11:13:43 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Michelle Konzack <starone AT cybercable DOT fr> wrote:
> Hello,

> I am making some Dostools and need to get an ERRORLEVEL.

> Can anyone point me to informations HOW TO DO IT ??? 

The ERRORLEVEL you can query by 'IF ERRORLEVEL' in a batch file is the
return value of main(), or equivalently the argument of exit(). I.e.
if you

	return 51;

inside main(), or

	exit(51);

anywhere in your program, the errorlevel will be 51.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019