Hi

Isn't EXIT a build in commando in the CMD.EXE and COMMAND.COM therefore it isn't possible thats not there.
You're right that the Win9x have no /b switch (I've not seen a Win9x machine for years :( ). According to some documentation I found in the web EXIT exits the command.com in Win9x (like without the /b switch in Win2k+).


There is another way which will work on Win9x too ... but it is more a hack :

Example:

ECHO %ERRORLEVEL% | CHOICE /C:12345678 /N >NUL

Will set the errorlevel 1-8. But it won't work with negative error levels or errorlevels greater or equal than 10. I don't know another way, sorry :/

Regards
Mike

Hi!

Please pay attention: in Win98, there is no /b parameter available.
A line as EXIT %ERRORLEVEL% exits, but I cannot say if it only exits the batch or the 
COMMAND.COM (that is the intended usage for the /B parameter in CMD.EXE)

In Win95, the EXIT command might be missing. I haven't tested, but I cannot remember to have seen it.

Another chance for Win9x systems would be to provide .COM files instead of .BAT files. But this would need some knowledge on building .COM files I haven't got.

Jochen


-----Urspr�ngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Mike Krueger Gesendet: Sonntag, 2. Mai 2004 21:07 An: Miguel de Icaza Cc: [EMAIL PROTECTED] Betreff: Re: [Mono-list] Windows: Propagating exit codes in .bat files?

Hi

try:
----------
mono mcs.exe
exit /b %ERRORLEVEL%
------------

Regards
Mike



Hey guys,

We have an issue with Mono, we are shipping batch files for Windows like this:

c:\>type mcs.bat
mono mcs.exe
c:\>

The problem is that if `mcs.exe' returns an exitcode different than zero, the error is not propagated to the caller, so this means that in Makefiles, things keep going even if there is a failure.

Anyone knows enough DOS to tell me how to fix that?

Miguel.

_______________________________________________
Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list









_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED] 
http://lists.ximian.com/mailman/listinfo/mono-list


_______________________________________________ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list






_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to