-
USB arrival detector
I'm testing a code that i found on Internet which detects cd-rom arrival. Now i want to change it in order to detect removable disk arrival.
This is the condition but it doesn't work
Code:
q.Condition = @"TargetInstance ISA 'Win32_LogicalDisk' and TargetInstance.DriveType = 2"
-
-
q is a WqlEventQuery Class
Try changing this:
Code:
q.Condition = @"TargetInstance ISA 'Win32_LogicalDisk' and TargetInstance.DriveType = 2"
to this:
Code:
q.Condition = @"TargetInstance ISA 'Win32_USBControllerdevice'";