How to use setx command in a windows batch file

前端 未结 4 969
轻奢々
轻奢々 2021-02-09 10:05

I am trying to create a windows batch file to automatically set the environment variable to use python 2.4 or python 3.3.

Both python 2.4 and 3.3 are installed on my sys

4条回答
  •  猫巷女王i
    2021-02-09 10:09

    The SETX command is very reliant on the syntax of the command. The following example shows the basic syntax to use to set the path environment variable:

    SETX PATH "%PATH%;Path to new thing added" /M
    

    This will also add the new path to the system registry, but still won't add it for the current session. Re-launch the terminal for it to take affect.

提交回复
热议问题