https://bugs.winehq.org/show_bug.cgi?id=57017
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|wine-bugs@winehq.org |eric.pouech@gmail.com Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1
--- Comment #6 from Eric Pouech eric.pouech@gmail.com --- Created attachment 76890 --> https://bugs.winehq.org/attachment.cgi?id=76890 second patch (need to apply first as well)
You're doing nothing wrong. The issue turns out to be in the "slight" discrepancies of handling a .bat and a .cmd files. Most of the commands behave the same, but some don't (in this very case, SET always sets ERRORLEVEL for .cmd file, but only sets it for .bat in case of error). Current Wine implementation always sets ERRORLEVEL for SET command.
For a succinct explanation: https://groups.google.com/g/microsoft.public.win2000.cmdprompt.admin/c/XHeUq...
I'll move that missing feature higher in my todo list; but I have a couple of other pending items on cmd.exe to handle before. So don't hold your breath on this one. To be done properly, we need to add a bunch of new tests, or even have a way to share the tests between the two .bat & .cmd cases.
Anyway, I attached a small hacky patch that you help in your very case.