https://bugs.winehq.org/show_bug.cgi?id=47791
Bug ID: 47791 Summary: Inconsistent %ERRORLEVEL% after setting env var value in cmd.exe Product: Wine Version: 4.16 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: lois.diqual@gmail.com Distribution: ---
Deleting an environment variable on cmd.exe seems to return %ERRORLEVEL% 1, while on windows' cmd.exe it returns 0.
This matters because some core visual studio scripts like vsdevcmd.bat rely on this behavior to set the environment properly. Note that using windows' cmd on wine (using winetricks cmd) yields the same incorrect results.
On wine's cmd.exe -----------------
wineuser@b081d9035bff:/$ wine cmd Microsoft Windows 10.0.10240
Z:>set DOES_NOT_EXIST=
Z:>echo %ERRORLEVEL% 1
On windows 10's cmd.exe -----------------------
Microsoft Windows [Version 10.0.17763.379] (c) 2018 Microsoft Corporation. All rights reserved.
C:\Users\IEUser>set DOES_NOT_EXIST=
C:\Users\IEUser>echo %ERRORLEVEL% 0