VBS获取硬盘序列号

标签: , , , ,

VBS调用WMI获取硬盘序列号,没什么技术含量,核心是Win32_PhysicalMedia类。

'SerialNumber
'By Demon
'http://demon.tw
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMedia",,48)

Dim objItem 'as Win32_PhysicalMedia
For Each objItem in colItems
    WScript.Echo "SerialNumber: " & objItem.SerialNumber
Next

参考链接:http://msdn.microsoft.com/en-us/library/windows/desktop/aa394346%28v=vs.85%29.aspx

随机文章:

  1. IPv6免费传文件——uTorrent鲜为人知的功能
  2. VeryPDF CHM to PDF Converter 2.0 注册码
  3. cURL 7.22.0 with zlib SSL and IPv6 support
  4. 本地机器和Windows 2003远程桌面之间复制粘贴文件
  5. VBS中Run和Exec的区别

留下回复