I'm trying to add C:\Program Files\Common Files\xxx\xxx
to the system PATH environment variable by appending %CommonProgramFiles%\xxx\xxx
to the existing path.
After rebooting, I open a command prompt and check the PATH. It expands correctly. However, when using Process Explorer from Sysinternals
to view the Environment variables on services.exe
, it shows the unexpanded version. Coincidentally, the paths using %SystemRoot%
expand and are recognized just fine.
I've tried altering the PATH through the Environment Variables window from System Properties and through direct Registry manipulation, neither seems to work.
Is it possible to use other environment variables, besides %SystemRoot%
in PATH and have services.exe
understand it?
Now I had a similar problem a while back, and I am never sure if I solved it due to time constraints. Problem is here that there are spaces in expanded variable. I am not sure the %PATH% var handles that correctly. I noticed the same thing a while back, and I am pretty sure, like
%ProgramFiles%
as well, it does not work at all period. I suspect it might have something to do with properly escaping the space, and the fact that it cannot handle that. I tried it quoted long before seeing that on Microsoft Answers, only to notice it did not work when that was what I presumed to be the problem. You might be SOL, which is why I moved things like SysInternals tools into dedicated directories with simplistic paths where spaces and other things would not be an issue.Remember, it's a feature, not a bug! Right?