http://bugs.winehq.org/show_bug.cgi?id=59234 Bug ID: 59234 Summary: Wine: Windows batch "WHERE" command return a wrong exit code in quiet mode Product: Wine Version: 10.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@list.winehq.org Reporter: charles@magicorp.fr Distribution: --- When we use the "WHERE" command in a batch script, the exit code indicates whether an executable file exists or not. For example, to find the `explorer.exe` path, we use `WHERE explorer`, which returns an exit code success and print the path list: ```txt C:\windows\system32\explorer.exe C:\windows\explorer.exe ``` It's possible to use the "WHERE" command in quiet mode to only return the exit code and not print anything. For example, to know if `explorer.exe` exists, we use `WHERE /Q explorer`, which returns an exit code success. This works on Windows, but on Wine, the quiet mode fails. To reproduce, execute the following batch script: ```bat WHERE /Q explorer && (ECHO SUCCESS) || (ECHO FAILED) WHERE explorer && (ECHO SUCCESS) || (ECHO FAILED) ``` On Windows, that script returns: ```txt C:\Users\charles\Downloads>WHERE /Q explorer && (ECHO SUCCESS ) || (ECHO FAILED ) SUCCESS C:\Users\charles\Downloads>WHERE explorer && (ECHO SUCCESS ) || (ECHO FAILED ) C:\Windows\explorer.exe SUCCESS ``` On Linux (Wine), `wine reproduce.bat`, that script returns: ```txt Z:\home\charles\a>WHERE /Q explorer && (ECHO SUCCESS) || (ECHO FAILED) FAILED Z:\home\charles\a>WHERE explorer && (ECHO SUCCESS) || (ECHO FAILED) C:\windows\system32\explorer.exe C:\windows\explorer.exe SUCCESS ``` -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.