WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

System Info

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

DMI Info Lookup

Keywords: 	 DMI Info lookup

Question:

Is anyone doing the DMI stuff with winbatch ?

If so could you post the code ?

Answer:

My code unfortunately requires intermediate files to be created since I have lost my programming skills in C a long time ago looking into seeing if it could be made more integrated.

There is also another version

IBM DMI Utilities at:

http://www.ibm.com/products/surepath/documents/utilities.html
they include source code and from the page, it is freely updatable code, royalty free.
rundir=filenameshort(dirhome())
line="/c %rundir%smbios2.exe /g 1 >%rundir%%computername%.bio"
Shellexecute("c:\command.com", line, "", @NORMAL,"")

smbios = FileOpen("%rundir%%computername%.bio", "READ")
manufacturer="unknown manufacturer"
product="unknown product"
pcserial="unknown serial#"

while @TRUE ; Loop till break do us end
x = FileRead(smbios)
If x == "*EOF*" Then Break
if StrIndexNc(x, "Manufacturer", 1, @fwdscan) >1 then
manufacturer=itemextract(2,x,"'")
endif
if StrIndexNc(x, "Product Name", 1, @fwdscan) >1 then
Product=itemextract(2,x,"'")
endif
if StrIndexNc(x, "Serial Number", 1, @fwdscan) >1 then
pcserial=itemextract(2,x,"'")
if pcserial=="," then pcserial="PC Serial#"
endif
endwhile
FileClose(smbios)
pcmodel = strcat(manufacturer,"-",product")



for winbios:
rundir=filenameshort(dirhome())
RunShell("%rundir%winbios.exe", "INI %rundir%%computername%.bio", rundir, @normal, @wait)

manufacturer=inireadpvt("System Info", "Manufacturer", "unknown manufacturer", "%rundir%%computername%.bio")
Product=inireadpvt("System Info", "Model Number", "unknown product", "%rundir%%computername%.bio")
pcserial=inireadpvt("System Info", "Serial Number", "unknown serial#", "%rundir%%computername%.bio")
Some machines respond only to one or the other, mix of compaq, toshiba and hp.
Article ID:   W15712
File Created: 2003:05:13:11:29:46
Last Updated: 2003:05:13:11:29:46