Windows Management Instrumentation (WMI,Windows管理规范) 是Web-Based Enterprise Management (WBEM)的Windows实现,是在Windows操作系统中管理和操作数据的基础设施。
Python扩展库wmi完美支持了WMI。首先使用pip命令安装该扩展库
1 #!/usr/bin/u/ubv/a python 2 # -*- coding:utf-8 -*- 3 4 import wmi 5 bios = wmi.WMI().Win32_BIOS()[0] 6 7 print(\'完整版本信息:\', bios.BIOSVersion) 8 print(\'内部识别号:\', bios.BuildNumber) 9 print(\'代码集:\', bios.CodeSet) 10 print(\'当前语言:\', bios.CurrentLanguage) 11 print(\'简要描述信息:\', bios.Description) 12 print(bios.IdentificationCode) 13 print(\'制造商:\', bios.Manufacturer) 14 print(\'名称:\', bios.Name) 15 print(\'当前操作系统:\', bios.TargetOperatingSystem) 16 print(\'是否主BIOS:\', bios.PrimaryBIOS) 17 print(\'安装日期:\', bios.InstallDate) 18 print(\'发布日期:\', bios.ReleaseDate) 19 print(\'序列号:\', bios.SerialNumber) 20 print(\'BIOS版本:\', bios.Version)