- May
- 13,808
- 211
That other thread was becoming a bit tedious. It seems that DO has nothing to do with it. It's just ON ERROR and a pipe. It's as though when ON ERROR is set and an error occurs, pipes are killed.
ON ERROR not set; pipe not killed:
ON ERROR set; pipe killed:
Code:
v:\> type batch3.btm
if "%1" = "use_on_error" on error echo ERROR!!!!!
echo 2
dir c:\foobar
echo 1
ON ERROR not set; pipe not killed:
Code:
v:\> batch3.btm | sort
TCC: (Sys) V:\batch3.btm [3] The system cannot find the file specified.
"C:\foobar"
0 bytes in 0 files and 0 dirs
718,061,199,360 bytes free
Volume in drive C is Windows Serial number is 3ed6:5d0d
1
2
ON ERROR set; pipe killed:
Code:
v:\> batch3.btm use_on_error | sort
v:\>