Why is ErrorLevel set only after || operator upon a failed redirection?
问题 Upon a failed redirection (due to a non-existent file or insufficient file access), the ErrorLevel value seems not to be set (in the following examples, file test.tmp is write-protected and file test.nil does not exist): >>> (call ) & rem // (reset `ErrorLevel`) >>> > "test.tmp" echo Text Access is denied. >>> echo ErrorLevel=%ErrorLevel% ErrorLevel=0 >>> (call ) & rem // (reset `ErrorLevel`) >>> < "test.nil" set /P DUMMY="" The system cannot find the file specified. >>> echo ErrorLevel=