T
T
Taylor_Superhero2016-05-04 11:25:35
cmd/bat
Taylor_Superhero, 2016-05-04 11:25:35

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

1 answer(s)
D
Dmitry Eremin, 2016-05-04
@Taylor_Superhero

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

or:
start node <pathToFile>\main.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question