本帖最后由 nyjy_hx 于 2021-1-6 14:21 编辑
- $wmi = ObjGet("winmgmts:\\")
- $net = $wmi.instancesof("win32_networkadapter")
- $msg = "本机物理网卡信息:" & @CRLF
- For $nt In $net
- If $nt.physicaladapter = True And StringInStr($nt.PNPDeviceID, "ROOT") = 0 Then $msg &= $nt.Description & @TAB & $nt.MACAddress & @CRLF
- Next
- $net = $wmi.instancesof("win32_OperatingSystem")
- $msg = $msg & "操作系统信息:" & @CRLF
- For $nt In $net
- $msg &= $nt.Caption & " " & $nt.osarchitecture & " " & $nt.Version & @CRLF
- Next
- $net = $wmi.instancesof("win32_DiskDrive")
- $i = 0
- $msg &= "本机硬盘信息:" & @CRLF
- For $nt In $net
- $msg &= $i & " " & $nt.Caption & " " & Round($nt.size / 1024 / 1024 / 1024, 2) & "GB" & @CRLF
- $i += 1
- Next
- MsgBox(0, "本机信息", $msg)
复制代码
才开始研究WMI 感觉有点小用处 这只是基本的一些代码哦!!!
|