Examine USB devices and auto-run files upon connection, using USBDeview
USBDeview is a small utility that lists all the USB devices currently connected to your computer, as well as all USB devices that you have previously used. For each USB device extended information is displayed: Device name/description, device type, serial number (for mass storage devices), the date/time that device was added, VendorID, ProductID, and more… USBDeview also allows you to uninstall USB devices that you previously used, and disconnect USB devices that are currently connected to your computer. You can also use USBDeview on a remote computer, as long as you login to that computer as administrator.
The program allows you also to test the read/write speed of your USB flash drive. It will let you even automatically run a file on USB flash memory devices, according to AutoRun.inf filename. You can manually activate the AutoPlay feature by selecting the desired device and pressing F8. Alternatively, You can check the “AutoPlay When Device Is Connected” option, and then the AutoPlay feature will be automatically activated when you insert a USB flash memory device. This feature works only if USBDeview detects the drive letter of the device.
USBDeview allows you to execute a command from exe/cmd/bat file every time you insert a USB device to your system. In order to use this feature, go to ‘Options->Advanced Options’, select the ‘Execute..’ check-box, and type the exe/cmd file that you want to run. Special variables are also available.