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

base/shell/cmd : move failure does not raise nErrorLevel

    XMLWordPrintable

    Details

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

      Description

      When performing a move to an open file, you get an error message,  but %errorlevel% is still 0

      you can try it out by

      • start cmd.exe
      • copy cmd.exe test.exe
      • move /Y test.exe cmd.exe
        you get errormessage with :  ...\test.exe => ...\cmd.exe [Error]
      • echo %errorlevel%  states 0 instead of 1

      to fix it:
      edit move.c,  changes lines 498 - 501  (from github 2c66af on Oct 3, 2017 )

              if (MoveStatus)
                  ConOutResPrintf(STRING_MOVE_ERROR1);
              else
                  ConOutResPrintf(STRING_MOVE_ERROR2);
      

      to

              if (MoveStatus)
                  ConOutResPrintf(STRING_MOVE_ERROR1);
              else {
                  ConOutResPrintf(STRING_MOVE_ERROR2);
                   nErrorLevel=1;
              }
      

       

       Hans

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hbelusca hbelusca
                Reporter:
                hansh Hans Harder
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: