You are not logged in.
The following claim at https://ss64.com/nt/syntax-conditional.html is incorrect
Use parenthesis to test the success of several commands:
(Dir C:\Test1 & Dir C:\Test2) || Echo One or more of the commands failed.
Actually the ECHO will only fire if the 2nd DIR fails.
The logic can be corrected by using && instead of &, but then the code short circuits - The 2nd DIR will not run if the 1st one fails
(Dir C:\Test1 && Dir C:\Test2) || echo One of the DIR commands failed.
And the parentheses are not required. The exact same logic is achieved by
Dir C:\Test1 && Dir C:\Test2 || echo One of the DIR commands failed.
The documentation problem was brought to my attention at https://stackoverflow.com/q/52724068/1012053
Dave Benham
Last edited by dbenham (09 Oct 2018 17:24)
Offline
Thanks Dave, I have updated the page now
Offline
Almost
You have a "dirst" DIR instead of first DIR
Offline
fixed now, thanks again Dave
Offline