Adding a directory to the PATH environment variable in Windows

前端 未结 18 1814
我在风中等你
我在风中等你 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 05:58

    WARNING: This solution may be destructive to your PATH, and the stability of your system. As a side effect, it will merge your user and system PATH, and truncate PATH to 1024 characters. The effect of this command is irreversible. Make a backup of PATH first. See the comments for more information.

    Don't blindly copy-and-paste this. Use with caution.

    You can permanently add a path to PATH with the setx command:

    setx /M path "%path%;C:\your\path\here\"
    

    Remove the /M flag if you want to set the user PATH instead of the system PATH.

    Notes:

    • The setx command is only available in Windows 7 and later.
    • You should run this command from an elevated command prompt.

    • If you only want to change it for the current session, use set.

提交回复
热议问题