Query the registry using Relevance

I need to implement a recursive search on the registry keys to find one with a specific name using the relevance. This is exactly what the command reg query "HKEY_USERS" /s /k /f "*xxx*" does when run on a Windows command prompt. I’m wondering if I can do the same with the relevance.

I know I can use key <string> of <registry> : registry key but this requires to provide a specific key path while in my case I don’t know what path the key might have.

If you know most of the path and the depth is consistent then this can be done quite simply.

pathnames of keys of keys "software\bigfix" of keys of key "HKU" of native registry

If the depth varies then it is more difficult, because there isn’t a registry equivalent of the descendants of , but I avoid that anyway and run a task to report the results i want to a flat file which I later interrogate. You could use the same technique for a variable depth registry search.

4 Likes