This is the value of my PATH from the System Variables section in Control Panel:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
This is the value from a DOS Command Prompt:
C:\Windows\System32>path
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
This is from a PowerShell prompt on a Windows 7 system:
C:\> $env:path
%SystemRoot%\system32\WindowsPowerShell\v1.0\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Wind
ows\System32\WindowsPowerShell\v1.0\
Note that all the other path strings are already expanded, except the first one that
PowerShell appears to be prepending.
This behavior, which was not in PowerShell 2.0 CTP3, is causing a problem for an in-house
tool in my company, which we can probably work around, but my question is, why is
PowerShell not expanding that variable before inserting it into the PATH? I think other
apps using the value of PATH would expect all the variables to be expanded already and not
have to do it again.
Chuck
To Fix this you'll need to modify the registry which comes with all the
usual warning about your computer not booting or causing the next IceAge if
not done correctly.
Under HKLM\Software\Microsoft\Windows\CurrentVersion
you'll find a key called "App Paths"
There will be an entry for Powershell under this key. The type of this key
should be REG_EXPAND_SZ but unfortuately is REG_SZ so the expandable variable
%SystemRoot% is not processed.
bob
"Chuck Heatherly" wrote:
> .
>