|
Hello,
To inventory wmi information, i want to create a kix script that read an ini file to get which WMI information i want to.
---INI FILE--- [WMI] ;WMI_INFO<n>=<wmi_param>,comment,<value1>,<value3>,...,valuen> WMI_INFO1=WIN32_BIOS,BIOS,Name,Version,SMBIOSBIOSVersion,Version
---KIX_SCRIPT--- $sMyIni="E:\Scripts\SysInvent.ini" For Each $sSection In Split(ReadProfileString($sMyIni,"",""),Chr(10)) If $sSection = "WMI" For Each $sEntry In Split(ReadProfileString($sMyIni,$sSection,""),Chr(10)) If $sEntry = "WMI_INFO1" $aEntry = Split(ReadProfileString($sMyIni,$sSection,$sEntry),",") $sImax = Ubound($aEntry) $WMI = $aEntry[0] $wmiColl = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * FROM $WMI") For Each $wmiObj In $wmiColl For $i = 2 to $sImax $sValueName = $aEntry[1] + "_" $WMI_RESULT = $wmiObj.$aEntry[$i] $sValue = $sValueName + $aEntry[$i] + $wmi_result + @CRLF ; $sValue = $sEntry + " : " + $sValue + @CRLF $ok = WriteFile("E:\Scripts\echo.txt",$sValue) Next Next EndIf Next EndIf Next
The writeline() function is working great.
My problem is this script don't get the wmi value that i want. I don't know how to script this ...
Thx for help.
Note : i'm french and my english is too bad. If you want, i can post a french version of. Thx
|