'Script for Win32_USBController WMI Class
'Generated using 'WMI Win32 Class Autoscript Generator' - Developed by Karthikeyan
'Homepage: http://www.geocities.com/marskarthik
On Error Resume Next
Computer = "."
Set OutFile = CreateObject("WScript.Shell")
Const ForAppending = 2
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile ("c:\temp\Win32_USBController.txt", ForAppending, True)
TextFile.WriteLine "Script for Win32_USBController Class by Karthikeyan"
TextFile.WriteLine
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery("Select * from Win32_USBController",,48)
For Each SubItems in Items
TextFile.WriteLine "********************************************************************"
TextFile.WriteLine "Availability: " & SubItems.Availability
TextFile.WriteLine "Caption: " & SubItems.Caption
TextFile.WriteLine "ConfigManagerErrorCode: " & SubItems.ConfigManagerErrorCode
TextFile.WriteLine "ConfigManagerUserConfig: " & SubItems.ConfigManagerUserConfig
TextFile.WriteLine "CreationClassName: " & SubItems.CreationClassName
TextFile.WriteLine "Description: " & SubItems.Description
TextFile.WriteLine "DeviceID: " & SubItems.DeviceID
TextFile.WriteLine "ErrorCleared: " & SubItems.ErrorCleared
TextFile.WriteLine "ErrorDescription: " & SubItems.ErrorDescription
TextFile.WriteLine "InstallDate: " & SubItems.InstallDate
TextFile.WriteLine "LastErrorCode: " & SubItems.LastErrorCode
TextFile.WriteLine "Manufacturer: " & SubItems.Manufacturer
TextFile.WriteLine "MaxNumberControlled: " & SubItems.MaxNumberControlled
TextFile.WriteLine "Name: " & SubItems.Name
TextFile.WriteLine "PNPDeviceID: " & SubItems.PNPDeviceID
TextFile.WriteLine "PowerManagementCapabilities: " & SubItems.PowerManagementCapabilities
TextFile.WriteLine "PowerManagementSupported: " & SubItems.PowerManagementSupported
TextFile.WriteLine "ProtocolSupported: " & SubItems.ProtocolSupported
TextFile.WriteLine "Status: " & SubItems.Status
TextFile.WriteLine "StatusInfo: " & SubItems.StatusInfo
TextFile.WriteLine "SystemCreationClassName: " & SubItems.SystemCreationClassName
TextFile.WriteLine "SystemName: " & SubItems.SystemName
TextFile.WriteLine "TimeOfLastReset: " & SubItems.TimeOfLastReset
TextFile.WriteLine "********************************************************************"
Next
TextFile.Close
OutFile.Run "notepad.exe c:\temp\Win32_USBController.txt",1,True
полезного нет... Чё это за зверь то?Вот есть WMI Class Win32_USBHub.
Он возвращает девайс, который включен в USB, и у него есть метод GetDescriptor, который дает хендл этого девайса.
В дальшейшем, можно использовать дескриптор для управления устройством.
Как? Мне было лень дальше копать, но в MSDN я думаю, можно найти ответ если копать в этом направлении.
Надо пользоваться поиском!
Извиняйте, искал в яндексе, ничего не нашёл.
[b]Private Sub Command1_Click()[/b]
'Script for Win32_USBController WMI Class
'Generated using 'WMI Win32 Class Autoscript Generator' - Developed by Karthikeyan
'Homepage: http://www.geocities.com/marskarthik
On Error Resume Next
Computer = "."
Set OutFile = CreateObject("WScript.Shell")
Const ForAppending = 2
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile("c:\temp\Win32_USBController.txt", ForAppending, True)
TextFile.WriteLine "Script for Win32_USBController Class by Karthikeyan"
TextFile.WriteLine
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery("Select * from Win32_USBController", , 48)
For Each SubItems In Items
TextFile.WriteLine "********************************************************************"
TextFile.WriteLine "Availability: " & SubItems.Availability
TextFile.WriteLine "Caption: " & SubItems.Caption
TextFile.WriteLine "ConfigManagerErrorCode: " & SubItems.ConfigManagerErrorCode
TextFile.WriteLine "ConfigManagerUserConfig: " & SubItems.ConfigManagerUserConfig
TextFile.WriteLine "CreationClassName: " & SubItems.CreationClassName
TextFile.WriteLine "Description: " & SubItems.Description
TextFile.WriteLine "DeviceID: " & SubItems.DeviceID
TextFile.WriteLine "ErrorCleared: " & SubItems.ErrorCleared
TextFile.WriteLine "ErrorDescription: " & SubItems.ErrorDescription
TextFile.WriteLine "InstallDate: " & SubItems.InstallDate
TextFile.WriteLine "LastErrorCode: " & SubItems.LastErrorCode
TextFile.WriteLine "Manufacturer: " & SubItems.Manufacturer
TextFile.WriteLine "MaxNumberControlled: " & SubItems.MaxNumberControlled
TextFile.WriteLine "Name: " & SubItems.Name
TextFile.WriteLine "PNPDeviceID: " & SubItems.PNPDeviceID
TextFile.WriteLine "PowerManagementCapabilities: " & SubItems.PowerManagementCapabilities
TextFile.WriteLine "PowerManagementSupported: " & SubItems.PowerManagementSupported
TextFile.WriteLine "ProtocolSupported: " & SubItems.ProtocolSupported
TextFile.WriteLine "Status: " & SubItems.Status
TextFile.WriteLine "StatusInfo: " & SubItems.StatusInfo
TextFile.WriteLine "SystemCreationClassName: " & SubItems.SystemCreationClassName
TextFile.WriteLine "SystemName: " & SubItems.SystemName
TextFile.WriteLine "TimeOfLastReset: " & SubItems.TimeOfLastReset
TextFile.WriteLine "********************************************************************"
Next
TextFile.Close
OutFile.Run "notepad.exe c:\temp\Win32_USBController.txt", 1, True
[b]End Sub[/b]
Malicious script detected. Your computer is halted and needs to do something about this script.
Object FileSystem Object
Activity OpenTextFile
at+mode=8
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 192