Batch file to open multiple cmd prompts

Posted by JHarris on Super User See other posts from Super User or by JHarris
Published on 2012-11-13T15:31:06Z Indexed on 2012/11/13 17:03 UTC
Read the original article Hit count: 185

Filed under:
|
|

I am trying to write a batch file that will automate the following manual process:

  1. Open a new cmd prompt (prompt1)
  2. Run a bat file (b1)
  3. Run a program (that will continue to run)
  4. Minimize prompt1
  5. Open a new cmd prompt (prompt2)
  6. Run a bat file (b1)
  7. Run a different program (that will continue to run)
  8. Minimize prompt2

I've found ways to open multiple instances of cmd to run different things, but after I've run the first thing (b1), I then need to run a program in that same cmd window.

I currently have

start /min cmd /k C:\Users\db2admin\python_environment\Scripts\activate.bat
start /min cmd /k C:\Users\db2admin\python_environment\Scripts\activate.bat

This opens the two windows and runs the bat, great, but now I need to execute another command (running a python file) in each of the cmd windows. How do I send commands to each prompt?

© Super User or respective owner

Related posts about command-line

Related posts about batch