Re regarding:
All errors, whether they are errors of invalid command names, invalid command parameters, or errors during command execution, can be divided into two categories: those sent to standard error stderr and those sent to standard output stdout. Although both default to pointing to the console device, they use different ports.
And the copy command of cmd is somewhat special because it sends many errors through standard output, so we use >file to redirect these error messages, but most commands under DOS and CMD usually send error messages through standard error. Therefore, your dichotomy is not universal.
In addition, the error redirection discussed by the original poster is still limited to the DOS environment, and 2> in the CMD environment is not discussed.
※ Batchinger 致 Bat Fans:请访问
批处理编程的异类 ,欢迎交流与共享批处理编程心得!