0

I currently have three batch files and am trying to combine the functionality into one.

run.bat
--------
start "" /min cmd /k first.bat
start "" /min cmd /k second.bat

first.bat
--------
call C:\Users\jh\python_environment\Scripts\activate.bat
coilmq

second.bat
--------
call C:\Users\jh\python_environment\Scripts\activate.bat
python "C:\Users\jh\run\main.py"

So I execute run.bat to get what I want. That opens two command windows, with the respective commands run in each one and then they are minimized. How can I combine all this functionality into one bat script?

2

run.bat

if not "%~1"=="" goto %1
start "" /min cmd /k "%~0" first
start "" /min cmd /k "%~0" second
goto :EOF

:first
call C:\Users\jh\python_environment\Scripts\activate.bat
coilmq
goto :EOF

:second
call C:\Users\jh\python_environment\Scripts\activate.bat
python "C:\Users\jh\run\main.py"
goto :EOF

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.