Adding a directory to the PATH environment variable in Windows

前端 未结 18 1348
我在风中等你
我在风中等你 2020-11-21 05:13

I am trying to add C:\\xampp\\php to my system PATH environment variable in Windows.

I have already added it using the Environment Varia

18条回答
  •  再見小時候
    2020-11-21 06:11

    You don't need any set or setx command. Simply open the terminal and type:

    PATH
    

    This shows the current value of PATH variable. Now you want to add directory to it? Simply type:

    PATH %PATH%;C:\xampp\php
    

    If for any reason you want to clear the PATH variable (no paths at all or delete all paths in it), type:

    PATH ;
    

    Update

    Like Danial Wilson noted in comment below, it sets the path only in the current session. To set the path permanently, use setx but be aware, although that sets the path permanently, but not in the current session, so you have to start a new command line to see the changes. More information is here.

    To check if an environmental variable exist or see its value, use the ECHO command:

    echo %YOUR_ENV_VARIABLE%
    

提交回复
热议问题