Scripting: Determine TPM VendorFrom an elevated command prompt, the following command returns the TPM vendor: wmic /namespace:\\root\cimv2\security\microsofttpm path win32_tpm get ManufacturerId /value For example: ManufacturerId=1229346816 To parse this in a batch script: for /f "skip=2 tokens=1,* delims==" %%x in ('wmic /namespace:\\root\cimv2\security\microsofttpm path win32_tpm get ManufacturerId /value') do if '%%y NEQ ' set TPMVendor=%%y If a TPM chip is not installed, this command echoes No Instance(s) Available to the error console, and the parsing doesn't work properly. So the error output could be redirected and the above can be expanded: set TPMVendor=None
for /f "skip=2 tokens=1,* delims==" %%x in ('wmic /namespace:\\root\cimv2\security\microsofttpm path win32_tpm get ManufacturerId /value 2^>nul') do if '%%y NEQ ' set TPMVendor=%%y In this example, 2>nul outputs the error text to the Null device, and the caret (^) is used in the for loop to indicate the next character should be used literally and not interpreted. The manufacturer ID is a 32-bit (ie. 4 byte) integer where each byte represents the ASCII value of the vendor's short name as specified here. Some short names are three characters long, some are four, and some are three but padded with a space at the end. In any case parsing the four bytes in a script is tedious when the list of vendors is relatively short and unchanging: AMD | 1095582720 | Ant Group | 1095652352 | Atmel | 1096043852 | Broadcom | 1112687437 | Cisco | 1129530191 | Flyslice Technologies | 1179408723 | Fuzhou Rockchip | 1380926275 | Google | 1196379975 | HP Inc | 1213221120 | HP Enterprise | 1213220096 | Huawei | 1212765001 | IBM | 1229081856 | Infineon | 1229346816 | Intel | 1229870147 | Lenovo | 1279610368 | Microsoft | 1297303124 | National Semiconductor | 1314082080 | Nationz | 1314150912 | NSING | 1314080512 | Nuvoton Technology | 1314145024 | Qualcomm | 1363365709 | Samsung | 1397576526 | SecEdge | 1397048133 | Sinosun | 1397641984 | SMSC | 1397576515 | STMicroelectronics | 1398033696 | Texas Instruments | 1415073280 | Winbond | 1464156928 | Wisekey | 1397047628 | |