6

I'm trying to automate a test process to first uninstall a product if present.

To find the product I've so far found that the information is available through wmi and wmic product get IdentifyingNumber, name, version | findstr /I /C:"Name" retrieves the info I need.

This query and search takes a long time, but I couldn't seem to get a wmi where clause to work.

Is there something I can do to make this faster?
Or, Is there some other method to get to the IdentifyingNumber?

1 Answers1

6

wmic solution using where

This should be faster as you don't need to pipe the output to findstr

wmic product where "name like 'Name'" get IdentifyingNumber, name, version

Example:

To find the information for iTunes

F:\test>wmic product where "name like 'iTunes'" get IdentifyingNumber, name, version
IdentifyingNumber                       Name    Version
{93F2A022-6C37-48B8-B241-FFABD9F60C30}  iTunes  12.1.2.27

Further reading

DavidPostill
  • 162,382