Posted on 2011-04-20 11:49
S.l.e!ep.¢% 阅读(527)
评论(0) 编辑 收藏 引用 所属分类:
VBScript
strOut = ""
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
'获取网卡的MAC地址
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
For Each objItem in colItems
strOut = strOut & "MAC Address: " & objItem.MACAddress &vbcrlf
msgbox strout
Next
'获取CPUID
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor")
For Each objItem in colItems
strOut = strOut & "Processor ID: " & objItem.ProcessorId&vbcrlf
Next
'获取硬盘序列号
Set colDiskDrives = objWMIService.ExecQuery _
("Select * from Win32_DiskDrive")
For each objDiskDrive in colDiskDrives
strOut = strOut & "Signature: " & vbTab & objDiskDrive.Signature
Next
'建立一个IE对象,并利用它的功能巧妙的把输出字符串复制到剪贴版里.
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("about:blank")
objIE.document.parentwindow.clipboardData.SetData "text", strOut
objIE.Quit
Wscript.Echo strOut