Use batch files (*.bat) to open multiple cmd windows at the same time
Recently, I was researching zookeeper and built several directories locally. I found that it is very cumbersome to frequently go to each directory to start zkServer.cmd, so google has the following:
When using a batch file, you can use the following method to open multiple cmd windows.
start is used to start an application
cmd /k means that the window will not be closed after the command following cmd is executed.
cmd /c means to close the command window after executing the cmd command.
example:
start cmd /k D:\ZookeeperLab\server1\zookeeper-3.4.8\bin\zkServer.cmd
start cmd /k D:\ZookeeperLab\server2\zookeeper-3.4.8\bin\zkServer.cmd
start cmd /k D:\ZookeeperLab\server3\zookeeper-3.4.8\bin\zkServer.cmd
The above lines of code are saved as go.bat.
In this way, running go.bat can open three cmd command windows at a time.