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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 0.4.15
    • Shell
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: