0 votes

I want to find folders that do NOT have a specific file. For example, given the following file structure:

X:\Foods\
X:\Foods\Carrots\
X:\Foods\Carrots\Nutrition.txt
X:\Foods\Carrots\Recipes.txt
X:\Foods\Apples\
X:\Foods\Apples\Recipes.txt
X:\Foods\Brownies\
X:\Foods\Brownies\Nutrition.txt

I want to find any folders that don't have a "nutrition.txt" file. Give the example, the search would return:
X:\Foods\Apples

I expect this is easy, and I'm having a user-head-space error, so thanks for your patience with the question.

asked by (120 points)

1 Answer

0 votes

It's actually a little harder than you might initially think. You need to search for all folders and use a script to filter out folders with your specific name. Fortunately the script is already included with the standard FileLocator Pro installation:

C:\Program Files\Mythicsoft\FileLocator Pro\Sample Scripts\folder_doesnot_contain.js

Step-by-step

  • Limit the search to only folders:

Folders Only

  • Specify the installed script folder_doesnot_contain.js along with the text to check for:

Script

  • Start the search

You should find that folders containing a file with the specified name are now excluded.

answered by (67.2k points)

Thanks! Your instructions are clear and, most import, they worked. Plus, you taught me a new feature of FilePro. I don't know the protocol for awarding reputation points. Let me know if 10 points are too few for an answer that works and will save me many headaches in future.

...