WMI - Search for Folder
Ivan F Moala
Can Do
Visits here
Goto Guest book sign in page [Home]
Greatest place to be
Thanks for visiting my site lucky visitor:
This page was last updated on: April 25, 2006
Copyright © 2002. XcelFiles. All Rights Reserved Ivan F Moala
Tell a friend about this page
Google
Search WWW Search My Site!

Have you ever had the need to search for Directories / Folders ?
No NOT Files within directories but ALL instances of a particular Directory name.
eg C:\Testing\Somedir, where Somedir is the Directory you wish to search for.

Lets say that you wish to search your system for a Directory, either ALL instances or the 1st instance ie you are not sure that a user has placed / saved / unzipped etc your files to the directory structure that you have set-up, so you need to do a search of the users system for that Directory name!

Not an easy task IF you have found a way. Using WMI and it's query interface ExecQuery it is now more manageable, here's how.

With the routine below it is easy to find the Directory/Folder within the persons computer system. Note, I said system = ALL drives and folders, sub directories within his system.

Just change the name of the Directory / Folder you wish to search for. There is the option to get the 1st instance of the name OR get ALL instances.

(For further references please see here)

Download example file here (more concise)