12.12.1: Expansion of Environment variables

Environment variables don't get expanded anymore by Opus in a DOS-button in 12.12.1 beta.

This works in 12.12:

"%programfiles%\7-Zip\7z.exe"

In 12.12.1 it stops with The system cannot find the path specified.

Adding cmd.exe /c will make it work again

cmd.exe /c "%programfiles%\7-Zip\7z.exe"

This will work, too:

cmd.exe /c "%programfiles%\7-Zip\7z.exe" l D:\mytest.7z

However, once there are more quotes involved the interpreter runs into problems.

This

cmd.exe /c "%programfiles%\7-Zip\7z.exe" l "D:\mytest.7z"

will stop with 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

Is a different approach needed?

(Out of curiosity: what is the reason for this recent change?)

It was an attempt to fix this:

But obviously with unexpected consequences. We'll put things back how they were in the next beta, at least until we come up with a better solution.

The original problem can be worked around with the @noexpandenv modifier anyway so it wasn't a crucial issue.

1 Like