Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How to run two commands in one line in Windows CMD?

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 performed on Windows?
by

2 Answers

RoliMishra
You can try this:
dir & echo foo
sandhya6gczb
You can use

command1 && command2

It runs the first command and then runs the second command only if the first command completed successfully.


(Command1 & command 2)

Use to group or nest multiple commands.

Login / Signup to Answer the Question.