Relevance for version of Outlook "less than" stated version

I am attempting to create an automatic group for tracking computers that have less than a supported version of Outlook installed on them but I only want to check on computers that have 2016 or above if that makes sense. The third query to check if the version is higher than 16.0.4600.1000 works but the one right below it that checks if it lower returns the error. What is causing this and is there a better way to do this?

q: version of regapp "outlook.exe"
A: 16.0.14729.20260

q: exists version of regapp "outlook.exe" whose ( version of it as string starts with "16.0" AND version of it > "16.0.4600.1000" as version )
A: True

q: exists version of regapp "outlook.exe" whose ( version of it > "16.0.4600.1000" as version )
A: True

q: exists version of regapp "outlook.exe" whose ( version of it < "16.0.4600.1000" as version )
E: Singular expression refers to nonexistent object.

In the third query, you don’t have a version lower than what you’re checking for, so regapp "outlook.exe" whose ( version of it &lt; "16.0.4600.1000" as version ) returns Nothing and then trying to query version of <nothing> gives the ‘singular expression’ error.

The easiest way to work around that is with plurals…

q: exists regapps "outlook.exe" whose ( version of it < "16.0.4600.1000" as version )
should give you a False

If you want to display the versions, use

q: versions of regapps "outlook.exe" whose ( version of it < "16.0.4600.1000" as version )

I think you were very close, and you final queries could be

q: exists of regapps "outlook.exe" whose ( version of it >= version "16" and version of it < "16.0.4600.1000")

q: versions of regapps "outlook.exe" whose ( version of it >= version "16" and version of it < "16.0.4600.1000")

edit: new keyboard

Thanks once again Jason. The last relevance statement you provided was exactly what I needed.

1 Like