Many simple issues with cmd.exe

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
sommanon
Newbie
Newbie
Posts: 2
Joined: Wed May 04, 2022 9:50 pm

Many simple issues with cmd.exe

Post by sommanon »

I've been using Wine (Linux Mint, wine-7.0) to run some large .bat scripts and have found many errors. Some of these are pretty simple/common usage, which is surprising considering how much Wine has improved in recent years.

Examples:
  • `&&` and `||` seem to just return true (workaround is an if/else on %errorlevel% if using `[command] && echo success || echo fail` )
  • `2>nul [command]` breaks (but `>nul [command]` and `[command] 2>nul` are fine)
Is everyone else able to replicate these issues?
Is there a quick workaround fix such as somehow upgrading cmd, or does it rely on submitting an issue and waiting for Wine devs to fix them?

There's also some weird issues where empty lines are messing up if/else statements and parentheses being misinterpreted as commands (maybe a side effect of something else failing), but I'll need to do more testing to figure out what the issues there really are.
sommanon
Newbie
Newbie
Posts: 2
Joined: Wed May 04, 2022 9:50 pm

Re: Many simple issues with cmd.exe

Post by sommanon »

There's also some weird issues [snip]
This appears to be echo commands containing parentheses are misinterpreted as commands.


As a workaround, I've copied out the cmd.exe in ReactOS (currently 32-bit) to run via wine, which doesn't have these issues.
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Many simple issues with cmd.exe

Post by jkfloris »

Indeed, there are still some (very old) bugs in Wine's cmd.
For example bug 32679

Maybe, you could use, as a temporary solution, Windows' cmd.

Code: Select all

winetricks cmd
Locked