8. Passing multiple commands

In 7.3 we used the character '&' to execute two commands in a single line.

D:\test>CD "my Doc" & DEL *  [ENTER]
The shell runs the first command ('CD') and then -unconditionally- the second command ('DEL'). 'Unconditionally' means regardless the result of the 'CD' command. So, this can be tricky. Better is to use two other passing methods with the conditional processing symbols '&&' and '||'.
D:\test>CD "my Doc" && DEL *  [ENTER]
Instead of '&' we use '&&'. It means that the shell runs the first command ('CD'). And only if the first command completed successfully, it runs the second command ('DEL'). So the following code will not run:
D:\test>CD "my DirNonExist" && DEL * [ENTER]
The third passing method uses '||'.
D:\test>CD "my DirNonExist" || DEL * [ENTER]
The shell will run the second command only if the first command fails. In this example it means that all files of D: est will be deleted! So handle with care!