package require twapi_wmi
package require twapi_process
namespace path twapi
set wmi [comobj_object winmgmts:root/cimv2]
set wql {SELECT * FROM Win32_BIOS}
set BIOS [$wmi ExecQuery $wql]
$BIOS -iterate bios_info {
puts -nonewline "Description: "
set DescriptionVal [$bios_info -with {Properties_ {Item Description}} Value]
puts $DescriptionVal
puts -nonewline "BIOS Manufacturer: "
set ManufacturerVal [$bios_info -with {Properties_ {Item Manufacturer}} Value]
puts $ManufacturerVal
puts -nonewline "Name: "
set NameVal [$bios_info -with {Properties_ {Item Name}} Value]
puts $NameVal
puts -nonewline "SMBIOSBIOSVersion: "
set SMBIOSBIOSVersionVal [$bios_info -with {Properties_ {Item SMBIOSBIOSVersion}} Value]
puts $SMBIOSBIOSVersionVal
puts -nonewline "Version: "
set VersionVal [$bios_info -with {Properties_ {Item Version}} Value]
puts $VersionVal
$bios_info -destroy
}
$BIOS -destroy
$wmi -destroy
2014-08-23
透過 WMI 取得目前 BIOS 的版本資料 (on WIndows platform)
使用 TWAPI 透過 WMI 取得目前 BIOS 的版本資料,下面是一個測試的 sample code:
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言