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?
 

My Computer

System One

  • OS
    Windows 8.1
    Computer type
    Laptop
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"
 

My Computer

System One

  • OS
    Windows 3.1 > Windows 10
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Dell XPS 8700
    CPU
    I7
    Memory
    24 GB
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?
 

My Computer

System One

  • OS
    Windows 8.1
    Computer type
    Laptop
Back
Top