0

I have a bunch of applications that I install using MDT packages. One of the packages needs an entry to the PATH variable. I would like to add a variable to the PATH variable. But this variable is not being translated.

My example: I would like to add a location to PATH: C:\Program Files\gs\gs9.55.0\bin Since this location uses a versionnumber, I find it easier to manage when I can create an extra variable. So I created an extra variable called GS_HOME with this location and added %GS_HOME% to PATH.

GS_HOME variable Added variable in PATH

When doing this manually, everything works fine. I test this by doing "echo %path%" and it gives me the PATH result with the translated %GS_HOME% variable Translated GS_HOME variable in PATH

The problem: When doing this via MDT, I can add the %GS_HOME% value just fine, and it shows up exactly the same in PATH. BUT the "echo %path%" test does not translate the %GS_HOME% variable. GS_HOME not translated

For extra info. I use these commands to create/modify the variables:

powershell -command "[Environment]::SetEnvironmentVariable(‘Path’, $env:Path + “;%GS_HOME%”, [EnvironmentVariableTarget]::Machine)"

cmd /c setx /M GS_HOME "C:\Program Files\gs\gs9.55.0\bin

0 Answers0