Link to home
Start Free TrialLog in
Avatar of victor2008
victor2008Flag for United States of America

asked on

How to explicitly exclude a file or subdirectory from search?

Is there a Dir command line option to search for a file or folder under a directory but exclude a specific subfolder in the search? dir /b /s ??
Avatar of Polydore Dracopoulos
Polydore Dracopoulos
Flag of United States of America image

i believe this may work:

dir /s | findstr "\thestrinyousearching*" |findstr /v "\thefolderyouwanttoexclude"
Avatar of victor2008

ASKER

that doesn't seem to work for me but i might be writing it wrong. i'm trying to search all *.pdf files in a directory but exclude one folder under the directory from my search
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial