https://bugs.winehq.org/show_bug.cgi?id=56399
Bug ID: 56399 Summary: cmd.exe's %~s modifier (short DOS path) expands to mixed short/long format Product: Wine Version: 9.2 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: tncgyp+uypezc35u0dyxed6tszn0wk59xjphxb2gcxycxno8mxg4od 48@sharklasers.com Distribution: ---
Try the following:
cd /tmp && printf 'for %%%%P in ("%%ProgramFiles%%\Internet Explorer") do winepath.exe -s %%%%P\r\n' > shortpath.bat && wine cmd.exe /c shortpath.bat && printf 'for %%%%P in ("%%ProgramFiles%%\Internet Explorer") do echo %%%%~sP\r\n' > shortpath.bat && wine cmd.exe /c shortpath.bat && rm shortpath.bat && cd "$OLDPWD"
The first batch file uses winepath.exe -s and returns 'C:\PROG~5P2\INTE~H1A'. The second batch file uses cmd.exe's %~s modifier and returns 'C:\PROG~5P2\Internet Explorer'. Wine's cmd.exe %~s modifier seems to be broken. It should produce the same path as winepath.exe -s. The second batch file works as expected with MS cmd.exe in a WinXP VM and a Win7 VM.
Tested on wine 9.2 with fresh prefixes and: - WINEARCH=win32 and wine cmd.exe - WINEARCH=win64 and wine cmd.exe - WINEARCH=win64 and wine64 cmd.exe