How to execute more than one command with wait in a .bat file

0

I searched around here and found no way to do that. In summary I need to create a .bat file and execute 3 commands:

1. Open a directory ( cd );

2. Run ( npm i );

after completing the above task

3. Run an .js on node.

    
asked by anonymous 20.07.2018 / 15:34

1 answer

2

You can create a normal bat file with one command on each line. When executing the bat it will execute the commands in sequence and will wait for the command to finish to execute the next one, ie, if you put the command npm install, the following commands will only be executed when the installation is finished.

An example of what the bat file looks like:

cd usuario echo %cd% npm i nodemon nodemon index.js

    
20.07.2018 / 15:52