在cmd窗口中执行bat文件时,如何更新PATH环境变量



任务是安装程序和几个模块。我想通过类似的bat文件来完成

python-3.6.4.exe /quiet InstallAllUsers = 1 PrependPath = 1
pip install intelhex-2.2.1-py2.py3-none-any.whl
pip install pyserial-3.4-py2.py3-none-any.whl

问题是安装python后,运行cmd.exe的环境变量没有更新,因此找不到与python一起安装的pip程序。

告诉我在从cmd执行bat文件时如何更新PATH变量?

请查看上的文档https://docs.python.org/3.6/using/windows.html

您可以使用DefaultAllUsersTargetDir指定安装目录。

此外,不要在参数名称和值之间使用空格字符。

python-3.6.4.exe /quiet InstallAllUsers=1 PrependPath=1

最新更新