通信人家园

标题: 用宏代码读取硬盘物理序列号,请大神验证  [查看完整版帖子] [打印本页]

时间:  2017-10-1 00:13
作者: xunzhao_211     标题: 用宏代码读取硬盘物理序列号,请大神验证

Sub auto_open()

Sheets("Sheet1").Cells(2, 1) = GetObject("winmgmts:").InstancesOf("Win32_PhysicalMedia")("Win32_PhysicalMedia.Tag=""\\\\.\\PHYSICALDRIVE0""").SerialNumber

Sheets("Sheet1").Cells(3, 1) = Trim(Sheets("Sheet1").Cells(2, 1))

End Sub




通信人家园 (https://www.txrjy.com/) Powered by C114