Relevance Help - Parsing Results of a RegKey

(imported topic written by SystemAdmin)

We are interested in displaying the version of a regkey value that contains additional data.

For example:

q: value “ChildBinary” of key “HKLM\SOFTWARE\Mrg” of native registry

a: C:\Windows\system32\Mrg\2.3.2.0\mrg.exe

We want to return “2.3.2.0”. We’ve looked at “preceding text of last” and “substrings between” but the coding is a little to advanced.

Any help would be appreciated!

(imported comment written by SystemAdmin)

Here you go. Notice the responses in the “I” section. This is the type of value that is returned. For instance I can’t ask a registry key what it’s version is I have to ask a file (e.g. exe, dll) what it’s version is. I replace your key with one I have on my system:

//first notice the “I” is “registry key value.” Can’t ask for a version of that.

q: (value “DLLFullPath” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\ASP.NET\2.0.50727.0” of native registry)

A: C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

T: 0.060 ms

I: singular registry key value

//first we cast it to string with the “as string” at the end so that you can manipulate it how you want (now the preceding text/substrings will work)

q: (value “DLLFullPath” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\ASP.NET\2.0.50727.0” of native registry as string)

A: C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

T: 0.057 ms

I: singular string

//We must now cast the string as a file so that we can ask for properties of a file.

q: file (value “DLLFullPath” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\ASP.NET\2.0.50727.0” of native registry as string)

A: “aspnet_isapi.dll” “2.0.50727.4927” “Microsoft ASP.NET ISAPI Shim DLL” “2.0.50727.4927 (NetFXspW7.050727-4900)” “Microsoft Corporation”

T: 0.239 ms

I: singular file

//finally let’s ask for the version of the file.

q: version of file (value “DLLFullPath” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\ASP.NET\2.0.50727.0” of native registry as string)

A: 2.0.50727.4927

T: 0.199 ms

I: singular version

(imported comment written by SystemAdmin)

This is a great approach! I wouldn’t have even thought to do it that way. Thank you for your time on this.

I’m getting “Error: Singular expression refers to nonexistent object.” which is odd because the file is certainly there and at that correct path. And the method works with EXE’s in other directories within System32.

I’ll work on that on my end. You’ve been a great help!

(imported comment written by SystemAdmin)

The issue with “nonexistent object” is that this particular EXE doesn’t register itself with the OS.

(imported comment written by SystemAdmin)

Did you get it working? If not feel free to copy and paste the failing relevance for additional thoughts.