PC のBIOSの情報を表示するサンプルコードです。
コマンド:
systeminfo | findstr -i /C:"BIOS バージョン"
実行例:
C:\>systeminfo | findstr -i /C:"BIOS バージョン"
BIOS バージョン: VMware, Inc. VMW71.00V.6997262.B64.1710270607, 2017/10/27
サンプル:
wmic bios get /value | findstr -i "Description"
wmic bios get /value | findstr -i "Manufacturer"
wmic bios get /value | findstr -i "SerialNumber"
wmic bios get /value | findstr -i "SMBIOSBIOSVersion"
実行例:
c:\>wmic bios get /value | findstr -i "Description"
Description=VMW71.00V.6997262.B64.1710270607
c:\>wmic bios get /value | findstr -i "Manufacturer"
Manufacturer=VMware, Inc.
c:\>wmic bios get /value | findstr -i "SerialNumber"
SerialNumber=VMware-56 4d f2 83 d1 97 04 74-18 aa 2c 25 a7 89 9e ea
c:\>wmic bios get /value | findstr -i "SMBIOSBIOSVersion"
SMBIOSBIOSVersion=VMW71.00V.6997262.B64.1710270607
サンプル:
Get-WmiObject Win32_BIOS | Format-List Description,Manufacturer,SerialNumber,SMBIOSBIOSVersion
実行例:
Description : VMW71.00V.6997262.B64.1710270607
Manufacturer : VMware, Inc.
SerialNumber : VMware-56 4d f2 83 d1 97 04 74-18 aa 2c 25 a7 89 9e ea
SMBIOSBIOSVersion : VMW71.00V.6997262.B64.1710270607
サンプル:
Set l = WScript.CreateObject("WbemScripting.SWbemLocator")
Set s = l.ConnectServer
Set cs = s.ExecQuery("Select * From Win32_BIOS")
For Each kaku_class In cs
WScript.Echo kaku_class.Description
WScript.Echo kaku_class.Manufacturer
WScript.Echo kaku_class.SerialNumber
WScript.Echo kaku_class.SMBIOSBIOSVersion
Next
Set kaku_class = Nothing
Set c = Nothing
Set s = Nothing
Set l = Nothing
実行例:
VMW71.00V.6997262.B64.1710270607
VMware, Inc.
VMware-56 4d f2 83 d1 97 04 74-18 aa 2c 25 a7 89 9e ea
VMW71.00V.6997262.B64.1710270607