I'm always noticing that many operations in .bat/.cmd user scripts performs incorrectly with current (v4.x stable) native cmd.exe module. Maybe there's no such an objective to have 100% compatibility with original command processor, but let's be consistent: people who set "Windows version" to "Windows 7" (or different) in WineCfg will expect that command line will behave like in selected OS too. Moreover, incorrect executing batch scripts may even harm user's data in cases where he doesn't even expects that.
1) Commands "mode" and "chcp" are not supported, although they play important role in some cases.
2) Constructions like
Code: Select all
for %%m in (blah blah) do if exist %%m (
do something...
)
Code: Select all
for %%m in (blah blah) do (if exist %%m (
do something...
))
Also, there's technically valid code that doesn't want to work in wine too, returning
Can't find "%LauncherLoc%_%~l.ini" and "do " is not a program or correct command.
Code: Select all
set AppLanguage=rus
set LauncherLoc=%cd%\launcher
for %%l in ("eng" "%AppLanguage%") do (
if exist "%LauncherLoc%_%%~l.ini" (
for /f "usebackq eol=; delims== tokens=1,*" %%a in ("%LauncherLoc%_%%~l.ini") do (
call set "%%~a=%%~b"
)))
4) Console window doesn't clear itself correctly with "cls" command and draws old text behind the new one.
5) Command "start /b ..." (run external file inside of current console window) doesn't work as intended and runs external console window.
Installing cmd.exe from winetricks or copying cmd.exe from Windows XP over the original one helps with 2) and 3), but not with others. To make "mode" and "chcp" commands work, we also need to copy chcp.com, mode.com, ulib.dll and ureg.dll from Windows XP. Also, CLS still doesn't normally work. Why the native cmd module is still so incomplete?