Use bat to open multiple cmd windows to execute gulp node

  • 2021-07-22 08:30:27
  • OfStack

1. Use scenarios

Usage scenario: Before project release

Operation steps:

1. Execute gulp to compress and merge files;

2. After the execution of 1 is completed, the files merged in 1, such as default. css, are automatically generated with multiple theme colors, and node is used here.

Problem: Manual operation steps are cumbersome

Open cmd- > Switch the execution directory- > Execute gulp- > Close cmd (this window cannot execute other commands after gulp executes)- > Open cmd- > Switch directories- > Execute node- > Turn off cmd

Requirements: Automate the above steps using. bat

2. bat code


 @echo off 
 start cmd /k "gulp" 
 start cmd /k "node modifyfile.js"

Related articles: