Adding %AppData% path to PATH

Hi,

Looking at deploying Python via Intune Company Portal which appears to stop the installer from adding items to the environment path. Using PSADT to run a post install script should work for the installation location e.g. C:\Program Files.… but doing the same for %AppData%\Python.… does not appear to get translated into C:\Users\username\appdata.… in PowerShell/Terminal e.g. $env:path shows ‘%appdata\Python.…’ rather than the full path.

I think I want to add the %appdata% path to System so as it’s there for all existing and future users (if that’s possible).

Has anyone managed this?

FYI: This is actually a Windows issue.

In the registry, the %PATH% environment variable is just a Reg_SZ string. A regular NON-EXPANDING string.

%TEMP% and %windir% as you can see are of Type REG_EXPAND_SZ and will Expand environment variables inside the string.

Not sure what you can do in your situation.

I’ve never had to use it myself, but you could try using the PSADT Environment variable $envAppData to see if this solves your issue?

See:

That would work only for ONE user.
Who ever $envAppData points to.

Maybe @Yar can find a “machine install” version of Python instead of this user-install garbage.

Look like there is specific install syntax to install Python for all users.
Although this is an old article (and for an older version of Python), but it looks like it has some clues for an all users install:

1 Like