Windows 8 and 8.1 Forums


How to detect a usb device from the command line

  1. #1


    Posts : 2
    Windows 8.1

    How to detect a usb device from the command line


    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 System SpecsSystem Spec

  2. #2


    Posts : 2,690
    Windows 3.1 > Windows 10


    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 System SpecsSystem Spec

  3. #3


    Posts : 2
    Windows 8.1


    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 System SpecsSystem Spec

How to detect a usb device from the command line
Related Threads
Hello everyone, i d like to disable my mic from command line http://leobastiani.bl.ee/mic.jpg how do i do that? thanks!
Hello everyone, i d like to disable my mic from command line http://leobastiani.bl.ee/mic.jpg how do i do that? thanks!
DOS Command Line in General Support
Hi there- Just reorganising my Library and for reasons I won't bore you with, need to do some mass amendments to Filenames to get rid of extraneous Info as I'm tight on Space. So, for instance, I have a Folder (DIRectory) with one hundred PDF, Mobi, RAR, ZIP, CBR and CBZ files in it all with...
New Command Line YouTube Player And Downloader With Local Playlists Support: mps-youtube ~ Web Upd8: Ubuntu / Linux blog
Hello, I Have Installed a Web App That Support IE7 Only, Means It display Bad on IE8,9,10. So I would like to know if There is a Command Line to Attach it to the IE Shortcut that Open the Web App in IE7 Computability mode, I'm Desperate to know a solution. Note: I'm Using Windows8 Pro with IE...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook