0

I'm writing a little batch script, and i'm trying to execute two different commands in a new command window.

Now, the window opens, but i'm unable to execute the commands in sequence.

Here's the code:

:KARMA_TEST_START
ECHO.
start cmd /k gulp compileUnit && karma start
GOTO MENU

I've tried everithing mentioned here: How to run two commands in one line in Windows CMD? but with no luck.

I'd like the new window to open, execute gulp compileUnit, after that, execute karma start and stay open (cause karma start should listen to changes and re-run every time by itself, that's why i need it to stay open).

Any help? thanks

Community
  • 1
  • 1
Nick
  • 13,493
  • 8
  • 51
  • 98
  • 2
    Try: `start cmd /k gulp compileUnit ^& karma start`. As you have it, the two commands are the `start` command and `karma` one. This way, both commands are passed as parameters of `start`. If you want to insert _two_ ampersand characters (for conditional execution), use `^&^&` – Aacini Feb 10 '16 at 12:46
  • awesome! it works. Thank you very much for your help and explanation – Nick Feb 10 '16 at 12:48
  • @Aacini please turn this into an answer so that we can get rid of this seemingly unanswered question – Marged Feb 10 '16 at 13:35

1 Answers1

0

Use: start cmd /k gulp compileUnit ^& karma start. As you have it, the two commands are the start command and karma one. This way, both commands are passed as parameters of start. If you want to insert two ampersand characters (for conditional execution), use ^&^&.

Aacini
  • 65,180
  • 12
  • 72
  • 108