I'm running a WMIC lookup against a series of remote client machines, pulling in Model and serial number.
For /F "tokens=*" %%b in ('wmic /node:%device% computersystem get Model /value^|find "Model"') do Set model=%%b
FOR /F "tokens=*" %%c in ('wmic /node:%device% bios GET serialnumber /value^|find "SerialNumber=" ') do set Serialnumber=%%c
The problem I have is that (for example) %serialnumber% is set to:SerialNumber=CNU8424GP3
I don't want the 'Serialnumber=', I just want the Serial number itself.
The only way I've found of stripping this is:
set SerialNumber=!serialnumber:SerialNumber=!
but this leaves an equals sign at the beginning of the line. So the final output is =CNUBFZXXY, what I would like to do is to remove the leading =, and I haven't been able to.
Any Suggestions?