0

I'm trying to open multiple instances of cmd up which each run a ruby script at the same time. For background into the scripts, each of these ruby scripts run watir-webdriver and spawn new browser instances. All of this should happen instantaneously.

Here's what I've tried:

start cmd /k
cd %USERPROFILE%\Desktop
ruby script_1.rb
start cmd /k
cd %USERPROFILE%\Desktop
ruby script_2.rb
start cmd /k
cd %USERPROFILE%\Desktop
ruby script_3.rb

However, only two cmd prompts opened and in the second one it just sits at the C:\Users\test\Desktop and doesn't run the command. I commented out each of the three ruby commands and then ran it and it opened up all three cmd prompts.

2
  • Why do you need to run cmd? start /D "%USERPROFILE%\Desktop" ruby script_1.rb should open a new console window. Commented Jun 17, 2015 at 14:05
  • Ah okay, I've never done batch scripting before so this is all new to me. Commented Jun 17, 2015 at 14:48

1 Answer 1

3

Try next approach:

pushd %USERPROFILE%\Desktop
start "1" cmd /k ruby script_1.rb
start "2" cmd /k ruby script_2.rb
start "3" cmd /k ruby script_3.rb
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.