Registry Property Returns Singular expression refers to nonexistent object

I am using a simple IF, THEN, ELSE statement. I do validate that the vaule exists, and then get the value. If the value is not present it should say Not Available.

Here’s my code:

IF exists (values “SecureProtocols” of keys “Software\Microsoft\Windows\CurrentVersion\Internet Settings” of current user keys (logged on users) of registry) THEN (values “SecureProtocols” of keys “Software\Microsoft\Windows\CurrentVersion\Internet Settings” of current user keys (logged on users) of registry as string) ELSE “Not Available”

Where am I going wrong?

if exists keys “Software\Microsoft\Windows\CurrentVersion\Internet Settings” whose (exists values “SecureProtocols” of it) of current user keys (logged on users) of registry then (values “SecureProtocols” of keys “Software\Microsoft\Windows\CurrentVersion\Internet Settings” of current user keys (logged on users) of registry as string) ELSE “Not Available”

2 Likes

Perfect, thanks Nick!