Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So I am wondering if I can run 2 cmd prompts and execute my program completely. I need the seleniumServer.jar to run in the background before i run my pythonScriptTemplate.py.

here is my code for the .bat file:

start
cd C:\Users\Colton\Project
java -jar selenium-server.jar
pause

start
cd C:\Users\Colton\Project
python seleniumScriptTemplate.py
pause


this does not work, it opens two cmd prompts, and the first one runs selenium. however, the second one does nothing but change my path to the path in the .bat file... any suggestions?
Posted
Updated 11-Feb-11 9:36am
v2
Comments
Sergey Alexandrovich Kryukov 11-Feb-11 15:38pm    
Type fixed in your title. Watch this: http://www.youtube.com/watch?v=u9_kahA_wQo
:-)
--SA

No wonder!

Don't pause, it makes not sense. Don't use start in cd, use it on application:

cd C:\Users\Colton\Project
start java -jar selenium-server.jar

cd C:\Users\Colton\Project
start python seleniumScriptTemplate.py


More exactly, I don't know for sure if your applications are console or not. I would rather assume pytnon runs on a console. This is almost certain. Then do this:


cd C:\Users\Colton\Project
start java -jar selenium-server.jar

cd C:\Users\Colton\Project
python seleniumScriptTemplate.py


You will start one application and bring another on console.

That's it! See my other Answer on how to get more information.

—SA
 
Share this answer
 
v3
Comments
fjdiewornncalwe 11-Feb-11 14:27pm    
Well explained. +5.
Sergey Alexandrovich Kryukov 11-Feb-11 14:32pm    
Thank you, Marcus.
--SA
#realJSOP 11-Feb-11 16:11pm    
Proposed as answer
Sergey Alexandrovich Kryukov 11-Feb-11 23:34pm    
Thank you. Accepted by OP.
--SA
Sergey Alexandrovich Kryukov 11-Feb-11 23:34pm    
Thanks for accepting my answer.
--SA
An addition to my concrete answer: learn just a bit of batch programming, it will never hurt.
Use my way to get complete reference on the topic.

Run this batch to generate the documentation our of available help:

Help generator — batch file.

This is not my work. Sorry, cannot tell the author right now; should be somewhere on my records.

—SA
 
Share this answer
 
going out on a limb...don't use start?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900