четверг, 28 ноября 2019 г.

Environment variables for PATH

First, we will be engaged in showing a path,
then we will advance to setting a path.

To show the path in CMD, use these commands:
PATH
or
SET PATH
(the last command adds info about path extensions, such as .COM;.EXE;.BAT;.CMD, etc)

If you want to show a path in a fine manner (row by row), use the next formula:
echo %PATH:;=&echo.%


In the PowerShell you need to use another command:
echo $Env:PATH


There is a more modern command SETX, for example:
setx path "%PATH%;C:\path\to\directory\"

For setting a path permanently, you may add /M switch:
setx /M path "%PATH%;C:\path\to\directory\"

That's all for today.


Комментариев нет:

Отправить комментарий