搜索
查看: 11576|回复: 2

物理驱动器信息检测

[复制链接]
发表于 2016-9-2 20:54:27 | 显示全部楼层 |阅读模式
本帖最后由 20011010wo 于 2016-9-2 22:37 编辑

利用VBScript,再包装了一下 QQ截图20160902205338.png ,有的数据可能有点小问题。
Physical Disk Properties.exe (329 KB, 下载次数: 866)


  1. 'Physical Disk Properties

  2. strComputer = "."
  3. Set objWMIService = GetObject("winmgmts:" _
  4.     & "{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2")
  5. Set colDiskDrives = objWMIService.ExecQuery _   
  6.     ("Select * from Win32_DiskDrive")

  7. For each objDiskDrive in colDiskDrives
  8.     Wscript.Echo "Caption: " & vbTab &  objDiskDrive.Caption & vbCrLf &  _
  9.    "Device ID: " & vbTab &  objDiskDrive.DeviceID & vbCrLf &  _
  10.    "Index: " & vbTab &  objDiskDrive.Index & vbCrLf &  _
  11.    "Interface Type: " & vbTab & objDiskDrive.InterfaceType & vbCrLf &  _
  12.    "Manufacturer: " & vbTab & objDiskDrive.Manufacturer & vbCrLf &  _
  13.    "Media Loaded: " & vbTab  & objDiskDrive.MediaLoaded & vbCrLf &  _
  14.    "Media Type: " & vbTab &  objDiskDrive.MediaType & vbCrLf &  _
  15.    "Model: " & vbTab &  objDiskDrive.Model & vbCrLf &  _
  16.    "Name: " & vbTab &  objDiskDrive.Name & vbCrLf &  _
  17.    "Partitions: " & vbTab & objDiskDrive.Partitions & vbCrLf &  _
  18.    "PNP DeviceID: " & vbTab &  objDiskDrive.PNPDeviceID & vbCrLf &  _
  19.    "SCSI Bus: " & vbTab &  objDiskDrive.SCSIBus & vbCrLf &  _
  20.    "SCSI Logical Unit: " & vbTab &  _
  21.         objDiskDrive.SCSILogicalUnit & vbCrLf &  _
  22.    "SCSI Port: " & vbTab &  objDiskDrive.SCSIPort & vbCrLf &  _
  23.    "SCSI TargetId: " & vbTab &  objDiskDrive.SCSITargetId & vbCrLf &  _   
  24.    "Sectors Per Track: " & vbTab &  _
  25.         objDiskDrive.SectorsPerTrack & vbCrLf &  _              
  26.    "Size: " & vbTab &  objDiskDrive.Size & vbCrLf &  _     
  27.    "Status: " & vbTab &  objDiskDrive.Status & vbCrLf &  _         
  28.    "Total Cylinders: " & vbTab &  _
  29.         objDiskDrive.TotalCylinders & vbCrLf &  _         
  30.    "Total Heads: " & vbTab &  objDiskDrive.TotalHeads & vbCrLf &  _   
  31.    "Total Sectors: " & vbTab &  objDiskDrive.TotalSectors & vbCrLf &  _
  32.    "Total Tracks: " & vbTab &  objDiskDrive.TotalTracks & vbCrLf &  _
  33.    "Tracks Per Cylinder: " & vbTab &  _
  34.         objDiskDrive.TracksPerCylinder  
  35. Next
复制代码



回复

使用道具 举报

发表于 2016-9-2 21:11:39 | 显示全部楼层
源码呢
回复

使用道具 举报

 楼主| 发表于 2016-9-2 22:07:32 | 显示全部楼层
回复

使用道具 举报

联系我们(Contact)|手机版|萝卜头IT论坛 ( 苏ICP备15050961号-1 )

GMT+8, 2024-11-23 21:46 , Processed in 0.105678 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表