Run two commands on the console (windows)

0

I want to execute two commands from the console / windows terminal in a single line (or instruction;)

In linux it would be something like cd directory && ls and would execute these commands one after the other, how can I get this result but in windows?

    
asked by Daniel Pérez 09.06.2017 в 20:32
source

2 answers

3

I have tried these commands in window cd dir && dir cd dir ; dir and it works, that is, I suppose you can do what you propose by separating the commands with ; or && . The ; executes them all one after another and the && executes them while they are successful, that is, if any fails the following ones are not executed.

    
answered by 09.06.2017 / 20:44
source
0

One solution you could implement is to create a batch, where all the code you want to run is found. If you want to do a test, generate the file and then call it from the console or just a double click would suffice.

I hope it's a solution to what you're looking for, regards.

    
answered by 09.06.2017 в 20:43