... 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
in this case you need to escape the > like this
for /F %%F in ('dir /B %* 2^> nul') do (