How do I run two commands in one line in Windows CMD?

后端 未结 19 1108
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 00:45

I want to run two commands in a Windows CMD console.

In Linux I would do it like this

touch thisfile ; ls -lstrh

How is it done on

19条回答
  •  广开言路
    2020-11-22 01:07

    I try to have two pings in the same window, and it is a serial command on the same line. After finishing the first, run the second command.

    The solution was to combine with start /b on a Windows 7 command prompt.

    Start as usual, without /b, and launch in a separate window.

    The command used to launch in the same line is:

    start /b command1 parameters & command2 parameters
    

    Any way, if you wish to parse the output, I don't recommend to use this. I noticed the output is scrambled between the output of the commands.

提交回复
热议问题