0

I'm not sure whether this exists or not, but I'm searching for a relatively simple program (Windows OS, preferably freeware) that probes folders (and their subfolders' subfolders - recursive scan) to determine whether a chosen file exists or not (e.g. Folder.jpeg - preferably case sensitive), and lists all the sub-directories where the said file is missing. Any ideas?

Thanks.

4
  • 1
    Your 'case sensitive' requirement is not possible under Windows. If folder.jpg exists on the disk, asking Windows to look for Folder.jpg (or any other case variation) will always find a match.
    – user416
    Mar 3, 2015 at 8:26
  • I suspect you have an other requirement: you don't just want to find the folders missing the file, you want to copy the missing file to those folders. Am I correct? In that case you may not need this kind of software at all. Just copy the file to old subfolders (with overwrite).
    – user416
    Mar 3, 2015 at 8:29
  • 1
    Do you mean the exact same file, or just a matching file name? Please edit your question.
    – user416
    Mar 3, 2015 at 8:29
  • Only a matching file name. I just want to find the folders where the file is missing.
    – FM931
    Mar 3, 2015 at 18:29

1 Answer 1

1

Install python for windows, (free and a small download), then you can use os.walk in a simple .py script, if the following is in a script at a known location then it will search the current folder recursively when called from the command line:

#!/usr/bin/env python
import os
LookingFor = 'Folder.jpeg' # case sensitive
for root, dirs, files in os.walk('.'): # Walk from the current directory down
    if '.svn' in dirs:
        dirs.remove('.svn')  # don't visit .svn directories as an example
    if LookingFor not in files: # this is case sensitive
        print root, 'is missing', LookingFor

Note 1: the above is python 2, for python 3 change the last line to:

        print(root, 'is missing', LookingFor)

Note 2: Indentation is crucial and should be all spaces not tabs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.