xuanhao 发表于 2015-10-7 12:16:19

自建Dell server 机器代码查询脚本(强烈推荐)

  #this is a vbs file.
  
  strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS",,48)
For Each objItem in colItems
strTAG = objItem.SerialNumber
Next
  strTAG = UCase(strTAG)
TAGLen = Len(strTAG)
tmp = 0
For i = 1 To TAGLen
ChrSerial = Asc(Mid(strTAG,i,1))
If ChrSerial > 47 And ChrSerial < 58 Then                '是数字
    ChrSerial = ChrSerial - 48
ElseIf ChrSerial > 64 And ChrSerial < 91 Then                '是字母
    ChrSerial = ChrSerial - 55
Else
    WScript.Echo "The Service TAG is error"
    WScript.Quit
End If
tmp = tmp + 36 ^ (TAGLen - i) * ChrSerial
Next
WScript.Echo "Service TAG: " & strTAG
WScript.Echo "Express Service Code: " & tmp
页: [1]
查看完整版本: 自建Dell server 机器代码查询脚本(强烈推荐)