Why doesn't my stderr redirection end after command finishes? And how do I fix it?

前端 未结 3 1120
后悔当初
后悔当初 2020-12-01 02:50

In Windows, either in command line or a batch file, the command DIR 2>NUL: 3>&2 (you can replace DIR with anything, even if isn\'t a file

3条回答
  •  广开言路
    2020-12-01 03:51

    The problem is with 3>&2. File descriptor 3 isn't valid, and it appears to upset Windows in some way. Leave it off, you don't need it.

    See Microsoft's documentation (archived) for the full treatment.

提交回复
热议问题