中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [已解决] 使用 WMIC 获得硬件信息
作者:
标题: [已解决] 使用 WMIC 获得硬件信息 上一主题 | 下一主题
chishingchan
银牌会员




积分 1282
发帖 538
注册 2002-11-2
状态 离线
『楼 主』:  [已解决] 使用 WMIC 获得硬件信息

我的电脑使用BUDDY拖机,如何使用 WMIC 获得键盘、鼠标、声卡、显卡等信息?
经过获取的信息再写入注册表完成主副机对硬件的分配。

[ Last edited by chishingchan on 2008-7-14 at 06:48 PM ]

2008-7-14 13:33
查看资料  发短消息 网志   编辑帖子  回复  引用回复
chishingchan
银牌会员




积分 1282
发帖 538
注册 2002-11-2
状态 离线
『第 2 楼』:  经搜索,已获得解决方法!

http://www.cn-dos.net/forum/view ... &highlight=WMIC

Wmic Path Win32_Keyboard
Wmic Path Win32_SoundDevice
Wmic Path Win32_PointingDevice
Wmic Path Win32_VideoController

再请问如何在 VBS 里应用?

2008-7-14 13:58
查看资料  发短消息 网志   编辑帖子  回复  引用回复
HAT
版主





积分 9023
发帖 5017
注册 2007-5-31
状态 离线
『第 3 楼』:  

看看文档吧,呵呵。

System Administration Scripting Guide.chm
http://upload.cn-dos.net/img/1032.zip

[ Last edited by HAT on 2008-10-30 at 20:19 ]



2008-7-14 14:51
查看资料  发短消息 网志   编辑帖子  回复  引用回复
chishingchan
银牌会员




积分 1282
发帖 538
注册 2002-11-2
状态 离线
『第 4 楼』:  



  Quote:
Originally posted by HAT at 2008-7-14 02:51 PM:
看看文档吧,呵呵。

System Administration Scripting Guide.chm
http://upload.cn-dos.net/img/600.zip

谢谢!收藏了。

2008-7-14 18:23
查看资料  发短消息 网志   编辑帖子  回复  引用回复
chishingchan
银牌会员




积分 1282
发帖 538
注册 2002-11-2
状态 离线
『第 5 楼』:  


On Error Resume Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_VideoController")

For Each objItem in colItems
        Wscript.Echo "Name:" & objItem.Name
    Wscript.Echo "DeviceID: " & objItem.DeviceID
    Wscript.Echo "Caption: " & objItem.Caption
   
        Wscript.Echo "CreationClassName; " & objItem.CreationClassName
        Wscript.Echo "AdapterRAM: " & objItem.AdapterRAM
        Wscript.Echo "CurrentBitsPerPixel: " & objItem.CurrentBitsPerPixel
        Wscript.Echo "CurrentHorizontalResolution;: " & objItem.CurrentHorizontalResolution
        Wscript.Echo "CurrentNumberOfColors: " & objItem.CurrentNumberOfColors
        Wscript.Echo "CurrentNumberOfColumns: " & objItem.CurrentNumberOfColumns
        Wscript.Echo "CurrentNumberOfRows: " & objItem.CurrentNumberOfRows
        Wscript.Echo "CurrentRefreshRate: " & objItem.CurrentRefreshRate
        Wscript.Echo "CurrentScanMode: " & objItem.CurrentScanMode
        Wscript.Echo "CurrentVerticalResolution: " & objItem.CurrentVerticalResolution
        Wscript.Echo "DriverDate: " & objItem.DriverDate
        Wscript.Echo "DriverVersion: " & objItem.DriverVersion
        Wscript.Echo "NumberOfColorPlanes: " & objItem.NumberOfColorPlanes
        Wscript.Echo "NumberOfVideoPages: " & objItem.NumberOfVideoPages
        Wscript.Echo "VideoArchitecture: " & objItem.VideoArchitecture
        Wscript.Echo "VideoModeDescription: " & objItem.VideoModeDescription
       
    Wscript.Echo
Next
Wscript.StdIn.Read(1)

On Error Resume Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_PointingDevice")

For Each objItem in colItems
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "Device ID: " & objItem.DeviceID
    Wscript.Echo "Device Interface: " & objItem.DeviceInterface
    Wscript.Echo "Double Speed Threshold: " & objItem.DoubleSpeedThreshold
    Wscript.Echo "Handedness: " & objItem.Handedness
    Wscript.Echo "Hardware Type: " & objItem.HardwareType
    Wscript.Echo "INF File Name: " & objItem.InfFileName
    Wscript.Echo "INF Section: " & objItem.InfSection
    Wscript.Echo "Manufacturer: " & objItem.Manufacturer
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "Number Of Buttons: " & objItem.NumberOfButtons
    Wscript.Echo "PNP Device ID: " & objItem.PNPDeviceID
    Wscript.Echo "Pointing Type: " & objItem.PointingType
    Wscript.Echo "Quad Speed Threshold: " & objItem.QuadSpeedThreshold
    Wscript.Echo "Resolution: " & objItem.Resolution
    Wscript.Echo "Sample Rate: " & objItem.SampleRate
    Wscript.Echo "Synch: " & objItem.Synch
Next
Wscript.StdIn.Read(1)

On Error Resume Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_SoundDevice ")

For Each objItem in colItems
        Wscript.Echo "Name:" & objItem.Name
    Wscript.Echo "DeviceID: " & objItem.DeviceID
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "Manufacturer: " & objItem.Manufacturer
        Wscript.Echo "ProductName: " & objItem.ProductName
        Wscript.Echo "DMABufferSize: " & objItem.DMABufferSize
    Wscript.Echo
Next
Wscript.StdIn.Read(1)

On Error Resume Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_Keyboard")
For Each objItem in colItems
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "Device ID: " & objItem.DeviceID
    Wscript.Echo "Is Locked: " & objItem.IsLocked
    Wscript.Echo "Layout: " & objItem.Layout
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "Number of Function Keys: " & objItem.NumberOfFunctionKeys
    Wscript.Echo "Password: " & objItem.Password
    Wscript.Echo "PNP Device ID: " & objItem.PNPDeviceID
Next
Wscript.StdIn.Read(1)


2008-7-14 18:51
查看资料  发短消息 网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: