How to detect a usb device from the command line

Ulysses

New Member
Messages
2
In linux I would type "lsusb" and it would list all usb devices plugged in. From this a "grep" would detect if a known usb device is connected.

How do you do the same from the command line in windows, eg in a batch file?
 
Code:
wmic diskdrive where "MediaType='Removable Media'" get Index,Model,Size

or to pipe to a txt file on desktop

Code:
wmic diskdrive where "MediaType='Removable Media'" get Index,Model,Size >"%userprofile%\desktop\RemovableMedia.txt"
 
Thanks but the device I want to test for is not a usb drive but a usb adapter (ethernet to usb). How do you test for this?
 
Back
Top