windows-search

Use Windows Search to find a lengthy list of files


I am searching for a relatively large collection (2000+) of files within a group of specific folders. The specific folder (and subsequent sub-folders) are indexed locations. I know the names and paths of all of the files. They are listed in an excel spreadsheet.

I wish to display them all in one saved search.

I am able to compile a search using AQS: name: filename1 OR name: filename2 .......OR name: filenameN AND Word. This code works well for a few file names. However, I have a list of about 2000 files. And copy and paste into the search window does not seem to work with such a large collection of search criteria.

I did try doing the paste with VBA. But I think my query is too large.

Also, because I have so many search criteria, I suspect compiling a .ms-search file from scratch will not be practical.

My question is: Is there a more elegant way of accomplishing this? Possibly something combining a series of excel formulas with the CMD Prompt.

Thank You


Solution

  • For anyone interested.

    I solved my problem using VB script. Instead of creating a saved search file, I will manually create a folder and "import" the links to it:

    Set oWS = WScript.CreateObject("WScript.Shell")
    sLinkFile = "C:\MyShortcut.LNK"
    Set oLink = oWS.CreateShortcut(sLinkFile)
        oLink.TargetPath = "C:\Program Files\MyApp\MyProgram.EXE"
    oLink.Save
    

    I used Excel formulas to concatenate the script and my known paths. Copy and paste to a .vbs file.