For application configuration items, a script may be specified to determine if an application is installed (as opposed to a Windows Installer GUID for instance). To do that, simply create a script that returns any kind of text. If text is returned, DCM will interpret that as a confirmation of installation. If no text is returned, then DCM will interpret that condition as though the application is not installed.
For example, I had to determine the configuration settings of a NIC. Since that is not something that is normally discoverable, I used the following script to determine if it was installed. Similarly, you can use scripting to determine if any thing is installed (software or hardware).
Set WMI = GetObject("winmgmts://./root/cimv2")
Set RS = WMI.ExecQuery("select * from Win32_PNPEntity where" & _
" DeviceID like 'PCI\\VEN_8086&DEV_109A%'")
If RS.Count > 0 Then WScript.Echo "Device Found"
Set RS = WMI.ExecQuery("select * from Win32_PNPEntity where" & _
" DeviceID like 'PCI\\VEN_8086&DEV_109A%'")
If RS.Count > 0 Then WScript.Echo "Device Found"
Comments 1
Thank you much for that useful post.
Posted 13 Sep 2009 at 11:30 pm ¶Post a Comment
You must be logged in to post a comment.