0 votes

I tried the script for How to search for folders that do NOT contain a particular file? but it doesn't seem to work with a wildcard search. Basically I'm trying to find folders that do not have a particular file type in them, for example a .doc file. I ran the script and tried it with and with a wild card .doc and it still pull every folder in the drive. I may be just doing it wrong.

asked by (30 points)
edited by

1 Answer

0 votes

The related question was dealing with searching for folders that didn't have a single specific file name. The code makes this simple test:

bIsValid = !objFSO.FileExists( strFolderPath + "\\" + SearchParms.FilenameCustomParm );

This wouldn't work with wildcards. Instead you need to use a different script, which is in the Sample Scripts folder:

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

This matches each item in the folder with the regex specified in the Parms field and if it matches the folder is ignored.

Folder does not contain regex

answered by (57.8k points)
Thanks a ton, exactly what I needed. :)