Answer the question
In order to leave comments, you need to log in
How to correctly run a JS script from a BAT file?
If you write start node main.js from CMD, then my script will start. But how to create a similar command in BAT? echo start node main.js gives no result. I tried to play with laying paths, but I'm probably doing something wrong.
Answer the question
In order to leave comments, you need to log in
wait a minute, if you keep the batch file in the same place as the js file, then it should work like this: start node main.js
. And put this in the batch file
if the batch file is in another place, then here either:
cd <path to js file>
start node main.js
start node <pathToFile>\main.js
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question