简体   繁体   中英

Batch file logic failing

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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