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?

closed as not a real question by Ƭᴇcʜιᴇ007, 3498DB, Diogo, BBlake, ChrisF Nov 13 '12 at 19:36

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    So far this is a great list of what you want, but not a good question. :) What have you come up with already? Where are you getting stuck? What have you tried already? – Ƭᴇcʜιᴇ007 Nov 13 '12 at 15:40
  • Literally have done nothing as I've never done batch scripting before. This is a process I currently do manually and want to give a one-click runnable to someone else so they don't have to do this process. – johnharris85 Nov 13 '12 at 15:42
  • Well we're not really here to write free scripts for you. We're here to help with, and offer suggestions for, problems you run into while doing things. :) Perhaps check out the Chat rooms, you may be able to find someone in there willing to consult with you on this at their regular fees. – Ƭᴇcʜιᴇ007 Nov 13 '12 at 15:47
  • @studiohack Why was my answer deleted? – Bali C Nov 13 '12 at 15:56
  • @techie007 see edit. – johnharris85 Nov 13 '12 at 16:07

Try using this

start /min cmd /c batch1.bat && start program1.exe
start /min cmd /c batch2.bat && start program2.exe

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