Thanks to the posts like this and this, I am able to get the PATH env variable and modify it as I please.
However, once I call System.Environment.GetEnvironmentVariable(name, scope)
, the returned string no longer has the PATH variable with %PathVariableName%
(such as %SystemDrive%
).
Instead of expected %SystemDrive%\folder
, I get C:\folder
.
While it functions as intended, I prefer to retain the variables if I can.
Is there any way to keep those path variable name when I call GetEnvironmentVariable?