VB如何遍历驱动程序?
VB如何遍历驱动程序名称?有可能做到吗?
回复 2楼 约定的童话
遍历驱动程序,不是遍历驱动器。
Private Sub Form_Load() Const wbemFlagReturnImmediately = &H10 Const wbemFlagForwardOnly = &H20 strComputer = "." Set objWMIService = GetObject("winmgmts://" & strComputer & "/root/CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_SystemDriver", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem In colItems 'Debug.Print objItem.DisplayName '驱动名称 Debug.Print objItem.PathName '驱动路径 Next End Sub
[此贴子已经被作者于2022-5-15 08:42编辑过]