Thursday, April 20, 2017

windows - Reuse of environment variables in Path

Is it possible to reuse environment variables in the Path environment variable from PowerShell?



There are some environment variables like %SystemRoot% defined and are used in Path variable ...;%SystemRoot%\system32;... viewed in the Advanced System Settings.



In PowerShell these are defined as $Env:SystemRoot and $Env:Path part of that path is resolved with ...;c:\windows\system32;...




How to create and use such a custom variable in the Path? e.g. $Env:MyPath = 'c:\mypath' adding it to Path like ...;%MyPath%\documents;... and get the same effect in both Advanced System Settings and PowerShell $Env:Path resolution?

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...