Wednesday, March 21, 2012

Open a Search for a Certain Type of File Every Day

I was in the process of converting scattered Microsoft Word .doc files to PDF.  I had found a way to automate the conversion of large numbers of such files, provided I was willing to put them all into a single folder; but that left me with some that would have to be handled on a more piecemeal basis, one folder at a time.

To aid in this process, I wanted my computer to give me a list of where my remaining .doc files were located, so that I could choose the ones that were ripe for conversion.  I had found Everything to be a very useful file finder.  On a one-time basis, I could find my Word docs by just typing *.doc on the Everything search line.  But now I wanted a command-line solution that would run Everything and do that search automatically.

I had not previously tried using Everything with command-line options, but now I found those options in the Everything wiki.  For this purpose, I found that this command would do the trick:

Everything -filename *.doc
That command worked because I had put a copy of Everything.exe (originally named Everything- into C:\Windows.  Now, if I wanted that command to run on a regular basis (say, once a day, or once a week), I could add it to a regularly scheduled batch file.  Not that I would have to; I could also just run it from the command line as needed, or save it in a batch file that I would run by double-clicking on it (or on a shortcut to it).