简体   繁体   English

更新批处理文件中的路径

[英]Updating the path within a batch file

I am writing a script that installs active python, and then "pip installs" two libraries: 我正在编写一个脚本,该脚本安装活动的python,然后“点安装”两个库:

IF %ARCH%==%tb% msiexec.exe /i Python\ActivePython-2.7.2.5-win32-x86.msi /qb
pip install requests
pip install pyserial

When I run this I get: 'pip' is not recognized as an internal or external command, ... 运行此'pip' is not recognized as an internal or external command, ...我得到: 'pip' is not recognized as an internal or external command, ...

But if I pull up powershell after the program is finished, pip has been added to my path and the listed commands work. 但是,如果我在程序完成后拉起Powershell,则pip已添加到我的路径中,并且列出的命令有效。

So my question is: How can I update the path within my batch file so I can use pip without starting a new process? 所以我的问题是:如何更新批处理文件中的路径,以便可以在不启动新进程的情况下使用pip?

You can try this: 您可以尝试以下方法:

@echo off
set "path=%path%;C:\my path update"

The semi colon is significant. 半冒号很重要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM