これとかどうですか?
#module WMImodule
#uselib "ole32.dll"
#func CoSetProxyBlanket "CoSetProxyBlanket" comobj,int,int,int,int,int,int,int
#define IID_IWbemLocator "{dc12a687-737f-11cf-884d-00aa004b2e24}"
#define CLSID_WbemLocator "{4590f811-1d3a-11d0-891f-00aa004b2e24}"
#usecom IWbemLocator IID_IWbemLocator CLSID_WbemLocator
#comfunc WbemLoc_ConnectServer 3 wstr,int,int,int,int,int,int,var
#define IID_IWbemServices "{9556dc99-828c-11cf-a37e-00aa003240c7}"
#define CLSID_WbemServices "{D68AF00A-29cb-43fa-8504-ce99a996d9ea}"
#usecom IWbemServices IID_IWbemServices CLSID_WbemServices
#comfunc WbemSvc_ExecQuery 20 wstr,wstr,int,int,var
#define IID_IEnumWbemClassObject "{027947e1-d731-11ce-a357-000000000001}"
#define CLSID_EnumWbemClassObject "{1b1cad8c-2dab-11d2-b604-00104b703efd}"
#usecom IEnumWbemClassObject IID_IEnumWbemClassObject CLSID_EnumWbemClassObject
#comfunc EnumWbem_Reset 3
#comfunc EnumWbem_Next 4 int,int,var,var
#define IID_IWbemClassObject "{dc12a681-737f-11cf-884d-00aa004b2e24}"
#define CLSID_WbemClassObject "{9A653086-174F-11d2-B5F9-00104B703EFD}"
#usecom IWbemClassObject IID_IWbemClassObject IID_IWbemClassObject
#comfunc WbemClsObj_Get 4 wstr,int,var,int,int
#deffunc GetWMIData array data,str query,str type
newcom pLoc, IWbemLocator
if( stat == 0 ){
WbemLoc_ConnectServer pLoc, "root\\cimv2", 0, 0, 0, 0, 0, 0, ppSvc
if( stat == 0 ){
newcom pSvc, IWbemServices, -1, ppSvc
if( stat == 0 ){
CoSetProxyBlanket pSvc,10,0,0,3,3,0,0
if( stat == 0 ){
WbemSvc_ExecQuery pSvc, "WQL", query, 48, 0, ppEnum
if( stat == 0 ){
newcom pEnum, IEnumWbemClassObject, -1, ppEnum
if( stat == 0 ){
dimtype vRet, vartype("variant")
repeat
EnumWbem_Next pEnum, -1, 1, ppclsObj, uReturn
if( uReturn == 0 ) : break
newcom pclsObj, IWbemClassObject, -1, ppclsObj
if( stat == 0 ){
WbemClsObj_Get pclsObj, type, 0, vRet, 0, 0
data(cnt) = vRet("value")
delcom pclsObj
}
loop
delcom pEnum
}
}
}
delcom pSvc
}
}
delcom pLoc
}
return
#global
screen 0, 500, 500 : title "WMI SAMPLE"
pos 100, 0 : mbData = "" : mesbox mbData, 400, 500
objsize 100, 20 : pos 0, 0
button gosub "1394Controller", *change : query(0) = "Select * from Win32_1394Controller"
button gosub "Account", *change : query(1) = "Select * from Win32_Account"
button gosub "BaseBoard", *change : query(2) = "Select * from Win32_BaseBoard"
button gosub "BIOS", *change : query(3) = "Select * from Win32_BIOS"
button gosub "Bus", *change : query(4) = "Select * from Win32_Bus"
button gosub "CDROMDrive", *change : query(5) = "Select * from Win32_CDROMDrive"
button gosub "DiskPartition", *change : query(6) = "Select * from Win32_DiskPartition"
button gosub "Display", *change : query(7) = "Select * from Win32_DisplayControllerConfiguration"
button gosub "Fan", *change : query(8) = "Select * from Win32_Fan"
button gosub "HeatPipe", *change : query(9) = "Select * from Win32_HeatPipe"
button gosub "Keyboard", *change : query(10) = "Select * from Win32_Keyboard"
button gosub "LogicalDisk", *change : query(11) = "Select * from Win32_LogicalDisk"
button gosub "MemoryArray", *change : query(12) = "Select * from Win32_MemoryArray"
button gosub "Process", *change : query(13) = "Select * from Win32_Process"
button gosub "Processor", *change : query(14) = "Select * from Win32_Processor"
button gosub "Product", *change : query(15) = "Select * from Win32_Product"
button gosub "USB", *change : query(16) = "Select * from Win32_USBController"
button gosub "Video", *change : query(17) = "Select * from Win32_VideoController"
button gosub "Volume", *change : query(18) = "Select * from Win32_Volume"
stop
*change
sdim data, 64 : mbData = "" : GetWMIData data, query(stat-1), "Name"
repeat length(data) : mbData += data(cnt) + "\n" : loop
objprm 0, mbData
return