geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarek Gawor (JIRA)" <>
Subject [jira] Commented: (GERONIMO-4525) No effective exit code for all Windows commands
Date Tue, 10 Feb 2009 01:32:59 GMT


Jarek Gawor commented on GERONIMO-4525:

Here's a simple batch and Java code that I used to experiment to whether resetting ERRORLEVEL
to 0 or calling is cmd /c exit /b %errorlevel%:
public class Test {

    public static void main(String [] args) throws Exception {

@echo off

@setlocal enableextensions

set foo=
echo %errorlevel%

java Test %1
echo %errorlevel%

echo %errorlevel%

Then when you execute Test.bat 0 or Test.bat 50 and check echo %ERRORLEVEL% after executing
it you should see that the %ERRORLEVEL% is set to the right value without doing anything extra.

> No effective exit code for all Windows commands
> -----------------------------------------------
>                 Key: GERONIMO-4525
>                 URL:
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: commands
>    Affects Versions: 2.1.3
>         Environment: MS Windows
>            Reporter: Jack Cai
>            Assignee: Jarek Gawor
>             Fix For: 2.1.4, 2.2
>         Attachments: Geronimo-4525_Jack.patch
> There are multiple problems in the current Windows batch commands (including geronimo.bat,
startup.bat, etc.)
>  - It's not recommended to define an environment variable with the name ERRORLEVEL. See
>  - Set a value to ERRORLEVEL has no effect to the exit code of the batch command (so
the documented exit code "0" and "1" are not actually there).
>  - The value of the ERRORLEVEL variable will also get unset when the "@endlocal" command
is called.
> [1]

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message