Find a Product's UpgradeCode from the Command Line

From a command prompt use a command like the following to find the IdentifyingNumber

Ā 

wmic product where "Name like '%Word%'" get Name,Version,IdentifyingNumber

Then use PowerShell to run a command like the following using the IdentifyingNumber as the GUID


gwmi -Query "SELECT Value FROM Win32_Property WHERE Property='UpgradeCode' AND ProductCode='{YourGuid}'" | Format-Table Value

Ā 

Ā© 2023 Foray, LLC - All Rights Reserved