In your case, it looks to me that you could use
REG Query HKLM\Software\Microsoft /V "DisplayName" /S
and then parse the output to find the name of the key you are looking for. /V
indicates to query for a value./S
indicates the search should be done recursively.
If this does not work and/or if I did not understand your question, check out Rob van der Woude's Scripting Pages which have a fairly extensive overview about searching the registry. This might teach you other ways to find your key as well.