windowsbatch-filepathpipactivepython

Updating the path within a batch file


I am writing a script that installs active python, and then "pip installs" two libraries:

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, ...

But if I pull up powershell after the program is finished, pip has been added to my path and the listed commands work.

So my question is: How can I update the path within my batch file so I can use pip without starting a new process?


Solution

  • You can try this:

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

    The semi colon is significant.