https://bugs.winehq.org/show_bug.cgi?id=52107
Bug ID: 52107 Summary: %ERRORLEVEL% shall not be reset when setting an environment variable in a batch file Product: Wine Version: 6.22 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: jinoh.kang.kr@gmail.com CC: others.meder@gmail.com Distribution: ---
The fix in https://bugs.winehq.org/show_bug.cgi?id=47791 (commit 617d14bc1238b57327a8400eda1c1ab22624beb7) is incomplete; it only applies to interactive case, and the bug is left unchanged for the batch mode case.
When a variable is successfully set, %ERRORLEVEL% is left as-is regardless of whether the interpreter is in batch mode or not.
See also: https://ss64.com/nt/set.html