Link to home
Create AccountLog in
Avatar of jb-smith
jb-smith

asked on

Scripting with Windows Desktop Search

Hello fellow scriptwriters,

I have been tasked with creating an automated search that will return file names of office documents containing a keyword, spread over hundreds of UNC paths.

I can return the list of files in each path (using powershell), but cannot find a way to script WDS to search within the office documents and return only the file names that contain the keyword.
Avatar of Jeremy Weisinger
Jeremy Weisinger

Are you wanting to use PowerShell?
Do you have the list of UNC paths in a txt file?
You could use something like this:
$results = foreach($uncpath in (get-content .\uncpaths.txt)){code to return query}

Open in new window

Avatar of jb-smith

ASKER

I would prefer PowerShell.
I have a loop that extracts data from a spreadsheet and converts to readable UNC, that was the easy part.

I am having problems scanning within office documents (I guess only WDS can do this).

The only missing component is scriping WDS.
Read through those same pages last week, but was holding out to see is there was some API call that would make everything easy. Something that accepted a string to search for and returned a string as the list of files found (metadata and all).
ASKER CERTIFIED SOLUTION
Avatar of Jeremy Weisinger
Jeremy Weisinger

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Well! That changes EVERYTHING! Thanks!
Will read tonight, meeting tomorrow on the progress of this script.

No time constraint on the search so this may work out well.
OK! Based on what you posted, Jeremy, I was able to use Microsoft Interop to do everything I needed. Wow, its like a great weight was lifted from my shoulders.