this is the code I have used for a while now that allows me to get bios info from a system during a dos lan logon . I can then load the image that is correct for the system.I am using 2 programs vpdump.exe and smbios2.exe both supplied to me from IBM (we have 4000 ibm systems)
the command line switches in smbios2.exe allow for geting more info from the bios if needed ( on some systems I can get the network card that is installed.)
I am useing kixtart version that works in dos so this code could be done better if you could do it from windows
I'm not sure if the code will post correctly as I don't know what the commands are to to separate it from the text.
;***********************************************************8
;********* kixtart for dos login that gets model and serial no.
;*************
;************* sections
;************* :
;************* :10/11/00 had to add provision to use smbios2 before vpddump... t-20s don't reconize serial number and model
;************* :
;************* :
shell "%comspec% /c n:\dosboot\smbios2.exe/g 01 >a:\smbios.txt"
"@error"?
"@ldrive"?
IF EXIST ("a:\smbios.txt")
$rc=OPEN(1,"a:\smbios.txt")
$offset=0
$string="Serial Number"
while $offset=0
$Line=READLINE(1)
$offset=INSTR("$Line","$string") ;************* serial no line is 22 model no is 34 both are both are 7 char long
;?"offset is : $offset"?
;" serial : $Line"?
if $offset=1 ;found serial no
$serial=$line ;this will change the $string to look for Model no because we have alredy found serial number
$offset=0
$string="Model Number"
$Serial=SUBSTR("$serial",LEN($serial)-6,7)
endif
if $offset=14 ;found model no
$model=$line
;$mod_lgth=LEN("$model")
$model=SUBSTR("$model",LEN($model)-6,7)
endif
Loop
? "$serial"?
"$model"
$rc=close(1)
;sleep 20
Endif
IF $serial = "" OR $model = ""
shell "%comspec% /c n:\dosboot\vpddump.exe >a:\vpd.txt"
"@error"?
"@ldrive"?
IF EXIST ("a:\vpd.txt")
$rc=OPEN(1,"a:\vpd.txt")
$offset=0
$string="Serial Number"
while $offset=0
$Line=READLINE(1)
$offset=INSTR("$Line","$string") ;************* serial no line is 22 model no is 34 both are both are 7 char long
;?"offset is : $offset"?
;" serial : $Line"?
if $offset=1 ;found serial no
$serial=$line ;this will change the $string to look for Model no because we have alredy found serial number
$offset=0
$string="Model Number"
$Serial=SUBSTR("$serial",LEN($serial)-6,7)
endif
if $offset=14 ;found model no
$model=$line
;$mod_lgth=LEN("$model")
$model=SUBSTR("$model",LEN($model)-6,7)
endif
Loop
? "$serial"?
"$model"
$rc=close(1)
;sleep 20
Endif
endif
;************* :
;************* :
;************* :
;************* :