File System Functions
The FileVersion* and ProductVersion* functions retrieve the information from the file described in the fullPath argument. This would match the values you would find by right clicking on the file in explorer and reviewing the Version tab.
RegistryValueEquals(SOFTWARE\Microsoft\Internet Explorer\Version Vector,IE,6.000)Constraints:
These are not the same and would be INVALID:
If the results of functions in the form described above evaluate to true, then it is assumed that the software is installed on the target machine, and there is no reason to install this package again. And, a corresponding copy of the software is counted in the K1000 appliance database.
Functions of the form *VersionGreaterThan and *VersionLessThan will attempt to do valid comparisons of version information. Only numeric versions can be compared. For example 1.2.3B would not compare correctly. The following would all behave normally:
Commas and parentheses as values in a rule
If comma, open parenthesis, or close parenthesis are to be used as values in a rule, they must be escaped as {{comma}}. {{op}}, and {{cp}}, respectively.
In arguments where commas are needed as part of the parameter value, the comma needs to be escaped as {{comma}}, except for the last argument in the function. |
For example, if you want to test against the registry value in which the value name is "test,value", the user would need to escape the comma in this case because registry value name is not the last argument in the Custom Inventory (CI) function.
RegistryValueEquals(HKEY_LOCAL_MACHINE\SOFTWARE\TestSoft, test{{comma}}value, HelloWorld)
If you wants to test against the registry value where the value itself contains a comma, then there is no need to escape, because value is the last argument in the Custom Inventory function. The following Custom Inventory tests registy value HKLM\SOFTWARE\TestSoft\test1 and looks to see if the value is equal to 2,4.
RegistryValueEquals(HKEY_LOCAL_MACHINE\SOFTWARE\TestSoft,test1,2,4)
If the Custom Inventory function contains only one parameter, it takes everything between the parentheses as the value for the argument. Commas in this case do not need to be escaped and will be part of the argument to the Custom Inventory function.
ShellCommandTextReturn(wmic MEMORYCHIP get BankLabel,Capacity,description,manufacturer)
An unmatched literal open parenthesis needs to be escaped as {{op}}. When the parser is tokenizing the arguments for the function, it counts the number of open and close parentheses to determine the end of the function and argument. Therefore, an unmatched literal open parenthesis would throw off the count, and cause the argument value to be parsed incorrectly. If a literal open parenthesis is needed as part of the argument value, it should be represented with {{op}}. |
For example, if you want to echo the string "Hello ( World", then the CI should look like the following:
ShellCommandTextReturn(echo Hello {{op}} World)
Unmatched literal close parentheses needs to be escaped as {{cp}}. |
While the parser is tokenizing the arguments for the function, it counts the number of open and close parentheses in order to determine the end of the function when it encounter the last matched close parentheses. However, if the argument value itself contains a close parenthesis that is not matched, the parenthesis tricks the parser to believe that is the end of the function and the argument value will be truncated prematurely.
If a literal close parentheses is needed as part of the argument value, it must be represented with {{cp}}.
For example, if you want to echo the string "Hello ) World", then the CI should look like the following:
ShellCommandTextReturn(echo Hello {{cp}} World)
For related information about creating Custom Data Fields, see the following FAQ-article: https://support.quest.com/kb/136057© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center