- May
- 13,738
- 209
Can I suppress the error messages that occur when "DO /S" cannot traverse a directory?
It might have been dumb, but I tried what's below and got quite surprising (buggy?) results (different each time). BTW, these (below) do eventually terminate, producing exactly as many lines of output as there are files to be processed by the DO command.
Code:
p:\4sysutils\release> do f in /s /a:-d /d"c:\" * ( echo %f )
IO.SYS
MSDOS.SYS
pagefile.sys
<snip>
TCC: (Sys) Access is denied.
"C:\$Recycle.Bin\S-1-5-21-1441759175-1591074457-3961414381-500\"
It might have been dumb, but I tried what's below and got quite surprising (buggy?) results (different each time). BTW, these (below) do eventually terminate, producing exactly as many lines of output as there are files to be processed by the DO command.
Code:
p:\4sysutils\release> 2>nul do f in /s /a:-d /d"c:\" * ( echo %f )
InternetInfo_hrww.rtf
InternetInfo_hrww.rtf
InternetInfo_hrww.rtf
InternetInfo_hrww.rtf
InternetInfo_hrww.rtf
^C
p:\4sysutils\release> 2>nul do f in /s /a:-d /d"c:\" * ( echo %f )
hpbcsiSWChooserWPFUI.resources.dll
hpbcsiSWChooserWPFUI.resources.dll
hpbcsiSWChooserWPFUI.resources.dll
hpbcsiSWChooserWPFUI.resources.dll
hpbcsiSWChooserWPFUI.resources.dll
^C