Comparing Values in the Registry

(imported topic written by tjordan_1291)

This:

Q: exists keys whose (value of it = “USB”) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class” of registry
A: False

Q: (names of it, values of it) of keys of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class” of registry as string
A: {25DBCE51-6C8F-4A72-8A6D-B54C2B4FC835}, WCEUSBS
A: {25DBCE51-6C8F-4A72-8A6D-B54C2B4FC835}, Windows CE USB Devices
A: {25DBCE51-6C8F-4A72-8A6D-B54C2B4FC835}, 1
A: {25DBCE51-6C8F-4A72-8A6D-B54C2B4FC835}, 1
A: {25DBCE51-6C8F-4A72-8A6D-B54C2B4FC835}, -20
A: {36FC9E60-C465-11CF-8056-444553540000}, USB
A: {36FC9E60-C465-11CF-8056-444553540000}, Universal Serial Bus controllers

Why am I getting a false when there is clearly a key with a value of “USB”? I’ve tried casting the value as a string for the comparison but I get the same result. What am I missing?

Thanks.

(imported comment written by NoahSalzman)

q: values whose (it is “USB”) of keys of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class” of registry

A: USB

q: exists values whose (it is “USB”) of keys of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class” of registry

A: True

(imported comment written by tjordan_1291)

Thank you. I wanted to extract the name of the key and ended up going with this:

item 0 of (names of it, values of it) whose (item 1 of it = “Network adapters”) of keys of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class” of registry

Not the most elegant code, but functional.