My Path
user environment variable includes references to other environment variables, for example (extract):
1 2 3 4 |
C:\> reg query HKEY_CURRENT_USER\Environment /v Path HKEY_CURRENT_USER\Environment PATH REG_EXPAND_SZ %USERPROFILE%\AppData\Local\Microsoft\WindowsApps; |
Suddenly, I was no longer reaching certain locations on the path. I discovered that the references to other environment variables were not being expanded.
1 2 3 |
C:\> set Path Path=%USERPROFILE%\AppData\Local\Microsoft\WindowsApps; |
Somehow, the type of Path
in the registry had been changed from REG_EXPAND_SZ
to REG_SZ
, which does not expand. Editing the variable via the Control Panel reset the type back to REG_EXPAND_SZ
, and solved the problem.