不懂VBS,仅瞎猜
#include <array.au3>
Local $colItems = ""
Local $strComputer = "localhost"
Local $Output = ""
Local $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", 0x10 + 0x20)
If IsObj($colItems) Then
For $objItem In $colItems
$Output = $objItem.SerialNumber
Next
EndIf
Local $tmp = 0
Local $ChrSerial = 0
$strTag = StringToASCIIArray($Output)
For $i = 0 To UBound($strTag) - 1
$ChrSerial = $strTag[$i]
If $ChrSerial > 47 And $ChrSerial < 58 Then
$ChrSerial -= 48
ElseIf $ChrSerial > 64 And $ChrSerial < 91 Then
$ChrSerial -= 55
Else
ExitLoop
EndIf
$tmp = $tmp + 36 ^ (UBound($strTag) - $i - 1) * $ChrSerial
Next
MsgBox(0, 0, "Service TAG: " & $strTag & @CRLF & "Express Service Code: " & $tmp)
|