PATH
consists of a list of directories, separated by semicolons, that are searched for
executables or executable scripts (whose suffixes is listed in
PATHEXT
) when trying to execute them without stating their location with an absolute directory path.
PowerShell
In
PowerShell, the individual
directories in the
PATH
variable can be printed each on its own line with one of the following two commands:
PS C:\> $env:path -split ';'
PS C:\> $env:path -replace ';', "`n"
The PATH
environment variable might contain a tilde (~
) which is used to shorten long paths:
PS C:\> $env-temp
C:\Users\DOMA~1.REN\AppData\Local\Temp
At times, the value of $env:temp
needs to be expanded to the real path. This is possible with
PS C:\> [System.IO.Path]::GetFullPath($env:temp)
C:\Users\DOMAIN.Rene\AppData\Local\Temp