Redirect output of command in for loop of batch script

前端 未结 2 1346
别跟我提以往
别跟我提以往 2020-12-30 03:15
...
for /F %%F in (\'dir /B %* 2> nul\') do (
...

What I\'m attempting to do here is discard the err output of the command (and loop over the st

2条回答
  •  爱一瞬间的悲伤
    2020-12-30 04:04

    I believe you need a delimiting space between the "2" and the ">". Without that delimiter my dir test output still displayed on the screen. Furthermore, I believe that by sending the output of the dir command to null will not provide any data back for the set to process.

提交回复
热议问题