I found this script on http://network-blog.lan-secure.com/2008/03/usb-detection-using-wmi-script.html
strComputer = \".\" \'(Any computer name or address)
colDrives is a collection of all connected drives, not last connected only. Should be:
strDriveLetter = "" For Each objDrive in colDrives strDriveLetter = strDriveLetter & objDrive.DeviceID Next