Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-10495

PATCH cmd: call internal command should set the %errorlevel% variable

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: 0.4.8
    • Component/s: Shell
    • Labels:

      Description

      Steps to reproduce:

      1) create (with your favorite test editor) a file called test.bat with the command

      exit /b 1

      2) open a command line interpreter and run the script by using:

      call test.bat

      3) run the command

      echo %errorlevel%

      Under React OS (r69843) you will get a 0

      But in Windows 7 it returns 1!

      (This is the only one version of Windows that I have to test this, could you please test it on others?)

      That I think is the most sensitive behavior, since many times you need to know the exit status of the called script). However this NOT documented
      in MSD (https://technet.microsoft.com/en-us/library/bb490873.aspx) which says nothing about %errorlevel% !!

      I have also tested this in FreeDos 1.1 (since React OS cmd is derived from its command interpreter), and I saw it has the same behavior (it returns 0).

        Attachments

        1. cmd-set_error_level.patch
          0.8 kB
        2. reactos-screenshot_after_patch.png
          reactos-screenshot_after_patch.png
          31 kB
        3. test1.bat
          0.0 kB
        4. test2.bat
          0.1 kB

          Issue Links

            Activity

              People

              • Assignee:
                hbelusca hbelusca
                Reporter:
                pdenapo pdenapo
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: