0

I needed to run the server and client console in a 'split mode'. The first attempt was:

w: && cd "w:\client"
npm run client

cmd -new_console:s
w: && cd "w:\server"
npm run server

In this case, only the first command is run.

Then I tried this approach:

start cmd /k w: && cd "w:\client" && npm run client
start cmd -new_console:s /k w: && cd "w:\server" && npm run server

No results at all.

Maybe someone has already faced such a problem?

John Lenson
  • 167
  • 2
  • 9
  • 1
    `cd /d "w:\client" && call npm run client`? – Stephan Jan 21 '19 at 11:06
  • `npm` is not an executable with file extension `.exe`. It is a batch file with file extension `.cmd`. For that reason a batch file which runs `npm.cmd` (write it always with file extension) needs to __call__ this batch file or Windows command processor never comes back to your batch file after finishing execution of `npm.cmd`. For more details on how to call a batch file from within a batch file see [this answer](https://stackoverflow.com/a/24725044/3074564) and see also [change directory command cd ..not working in batch file after npm install](https://stackoverflow.com/questions/38676130/). – Mofi Jan 21 '19 at 11:31
  • @Stephan, what about second command? It would not start until the first `npm run` exits, which is what I don't want to happen. – John Lenson Jan 21 '19 at 14:57
  • 1
    ah - you want to run them parallel. `start "Client" /d "w:\client" npm run client` and `start "Server" /d "w:\server" npm run server`. See `start /?`. – Stephan Jan 21 '19 at 15:00
  • Apparently "split view" and the command-line option "-new-console" is specific to cmder, for those among us who have never used it, such as myself. – Eryk Sun Jan 21 '19 at 16:56

1 Answers1

0

Ok, so I figured out how to run both processes, but not in a split view

cd /d "W:\client"
start npm run client

cd /d "W:\server"
start npm run server

Does any one know how open second process in a split view?

John Lenson
  • 167
  • 2
  • 9