Why can't I get user input when & 0 stream is redirected
Follow MS documentacion .
We have duplicate descriptors
2>&1 : Take the handle in the stream 1,
duplicate it
and place the copy as the handle in stream 2.
and redirection operators
2>file : Get a handle to the file and
place the handle to be used as stream 2
<file : Get a handle to the file and
place the handle to be used as stream 1 (implicit)
In all cases, the handle is obtained (copied or not) and placed as a handle for the specified stream.
Now your code
set /p= 0>nul
^^^^^ .... What does it mean?
This means: open the stream to the nul“device” and set the handle to this stream (copy / duplicate it) as the handle to stream 0
, ( , . )
set /p= <nul
set /p= 0>nul
, &0, nul.
, .
set /p= 0<conset /p= 0>con?
, - . , , &0 , ?
. , &0, , , . , :
<>
,
- , ,
- , ,