| 1. |
Solve : more than one command per line in a batchfile?? |
|
Answer» Anybody know if it is possible to run more than one command in a line in a batchfile (instead of making a :label) In some cases, I don't know when but && can also be used. I think you mean the single ampersand symbol &. The double ampersand && has a different meaning. Single AMPERSANDS allow multiple statements on one line Code: [Select]CLS & echo hello world & pause & del temp.txt Is the same as Code: [Select]CLS echo hello world pause del temp.txt double ampersands allow conditional execution. If the code to the LEFT of the && is successful, the code to the RIGHT is executed Code: [Select]tasklist | findstr "Notepad.exe" && echo Notepad is running The opposite to this is a double pipe symbol || If the code to the LEFT of the || is NOT successful, the code to the RIGHT is executed. Code: [Select]tasklist | findstr "Notepad.exe" || echo Notepad is NOT running Yea, thats it. A single & not two would be used in your CASE. |
|