Batch file logic failing

168 Views Asked by At

I'm trying to get a to execute the following code:

cmd /K C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3
cd C:\ProgramData\Anaconda3\Lib\site-packages\tabpy_server\
run startup.bat

The first line execute properly and opens an window. The next lines fail to execute.

What am I missing?

The idea is to create a batch file which can be added to to start the server service.

1

There are 1 best solutions below

0
On

There is no run command in batch. What you want is the start command. Also you want to use call instead of cmd /k because it is used for starting another instance of cmd while you just want to call the batch file. Here is an example:

call C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3
cd C:\ProgramData\Anaconda3\Lib\site-packages\tabpy_server\
start startup.bat