L
L
Ler Den2018-05-03 01:46:16
cmd/bat
Ler Den, 2018-05-03 01:46:16

How to run pm2 via bat file?

I want to make a bat file that will perform a sequence of actions:
1. Go to a folder a level higher
2. Go to the backend folder
3. Start the server with the command "pm2 start index.js"
4. Start the logs "pm2 logs"
It is advisable to leave the console open
Now I stumbled on the third point. Two consoles open, one with the desired folder, and the second one does not understand what it is doing.

start /min cmd /k cd ..\backend
start "pm2 start index.js"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-05-03
@givemoneybiatch

start ..\backend\pm2 start index.js
..\backend\pm2 logs

cd ..\backend\
start pm2 start index.js
pm2 logs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question