自建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

posted @ 2012-07-05 13:42  21人  阅读(206)  评论(0编辑  收藏  举报
无觅相关文章插件,快速提升流量