I need to redirect keyboard input + text + error text in CMD to nul with maximum 2 expressions.
Something like *command* >nul 2>&1
.
An alternative is >nul 1>nul 2>nul
but as I said, I want to reduce the command as much as possible.
Thanks.
I am not aware of a way of redirects all 3 (stdin
, stdout
& stderr
) to nul
in any less than 3 commands.
So, if that is acceptable - Similar to Hidden features of Windows batch files - command <nul >nul 2>&1
, which redirects stdout
to nul, and stderr
to the same place as stdout
0 = stdin
1 [Default is omitted like in example] = stdout
2 = stderr