Search This Blog

Thursday, June 17, 2021

Seeking A but Found (Fascinating) B Part Two

Of course, because I gave up looking and clicked "Publish" for the previous post, it meant I was sentencing myself to have a solution revealed to me when I clicked a link in my search results as this page - https://stackoverflow.com/questions/51076632/exclude-certain-subfolders-when-scanning-the-contents-of-a-folder - revealed the following solution:


for /F "delims=" %%D in ('dir /B /S /A:D "C:\myFolder" ^| findstr /I /V /C:"\\Users\\" /C:"\\Windows\\"') do echo/%%D

with $RECYCLE.BIN listed in the "C:\exclude.txt" file.

for /F "delims=" %%D in ('dir /B /S /A:D "C:\myFolder" ^| findstr /I /V /L /G:"C:\exclude.txt"') do echo/%%D


No comments: