top of page

use /v option to exclude results


Adding a simple option can allow you to modify the results returned with dir, findstr, and other Windows commands. /v will exclude lines including what is designated in parentheses after it. So for example, this command:

dir /s /b | findstr /i "Milwaukee"

. . . will search for all files and folders which include the search term, "Milwaukee". Modifying the command with the /v option can exclude results from directories which include the string, "beer"

dir /s /b | findstr /i "Milwaukee" | findstr /v "beer"


bottom of page