获取机器码并注册那位朋友帮个忙给改改先谢谢了!!!
MsgValue = ""Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
获取硬盘序列号
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMedia", , 48)
For Each objItem In colItems
MsgValue = MsgValue & vbCrLf & "硬盘 = " & objItem.SerialNumber
Next
'获取主板序列号
Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard", , 48)
For Each objItem In colItems
MsgValue = MsgValue & vbCrLf & "主板=" & objItem.SerialNumber
Next
'获取CPU ID
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor", , 48)
For Each objItem In colItems
MsgValue = MsgValue & vbCrLf & "CPU = " & objItem.ProcessorId
Next
'获取BIOS序列号
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS", , 48)
For Each objItem In colItems
MsgValue = MsgValue & vbCrLf & "BIOS= " & objItem.SerialNumber
Next
'获取网卡MAC地址
Set colItems = objWMIService.ExecQuery("SELECT MACAddress FROM Win32_NetworkAdapter WHERE ((MACAddress Is Not NULL) AND (Manufacturer <> 'Microsoft'))", , 48)
For Each objItem In colItems
MsgValue = MsgValue & vbCrLf & "网卡 = " & objItem.MACAddress
Next
Wscript.Echo MsgValue