windows - Get USB key manufacturer serial number

30
2014-06
  • Maxbester

    I am looking for a batch command to retrieve an USB key manufacturer serial number. I need a command that works in both Windows XP and Windows Seven.

    This is for a hardware follow-up. I have a script that sends emails when a problem occurs and it needs to include a way to identify the removable disk.

    At first I used vol e: but the number changes when the disk is formatted.

    On several sites I saw wmic diskdrive get serialnumber but it doesn't seem to work (at least on W7). The command returns Invalid XML.

    This is not surprising. I ran wmic diskdrive get /? and the available options are:

    Property                               Type                    Ope
    ========                                ====                    ===
    Availability                            N/A                     N/A
    BytesPerSector                          N/A                     N/A
    Capabilities                            N/A                     N/A
    CapabilityDescriptions                  N/A                     N/A
    CompressionMethod                       N/A                     N/A
    ConfigManagerErrorCode                  N/A                     N/A
    ConfigManagerUserConfig                 N/A                     N/A
    DefaultBlockSize                        N/A                     N/A
    Description                             N/A                     N/A
    DeviceID                                N/A                     N/A
    ErrorCleared                            N/A                     N/A
    ErrorDescription                        N/A                     N/A
    ErrorMethodology                        N/A                     N/A
    Index                                   N/A                     N/A
    InstallDate                             N/A                     N/A
    InterfaceType                           N/A                     N/A
    LastErrorCode                           N/A                     N/A
    Manufacturer                            N/A                     N/A
    MaxBlockSize                            N/A                     N/A
    MaxMediaSize                            N/A                     N/A
    MediaLoaded                             N/A                     N/A
    MediaType                               N/A                     N/A
    MinBlockSize                            N/A                     N/A
    Model                                   N/A                     N/A
    Name                                    N/A                     N/A
    NeedsCleaning                           N/A                     N/A
    NumberOfMediaSupported                  N/A                     N/A
    PNPDeviceID                             N/A                     N/A
    Partitions                              N/A                     N/A
    PowerManagementCapabilities             N/A                     N/A
    PowerManagementSupported                N/A                     N/A
    SCSIBus                                 N/A                     N/A
    SCSILogicalUnit                         N/A                     N/A
    SCSIPort                                N/A                     N/A
    SCSITargetId                            N/A                     N/A
    SectorsPerTrack                         N/A                     N/A
    Signature                               N/A                     N/A
    Size                                    N/A                     N/A
    Status                                  N/A                     N/A
    StatusInfo                              N/A                     N/A
    SystemName                              N/A                     N/A
    TotalCylinders                          N/A                     N/A
    TotalHeads                              N/A                     N/A
    TotalSectors                            N/A                     N/A
    TotalTracks                             N/A                     N/A
    TracksPerCylinder                       N/A                     N/A
    

    No SerialNumber...

    Do you have a better idea?

    Thanks

  • Answers
  • Maxbester

    I've finally found the solution on Stackoverflow.

    The SerialNumber property doesn't exist.

    I now use:

    wmic diskdrive get PNPDeviceID

    But a fix exists from Microsoft here.


  • Related Question

    USB to Serial adapter/cable Windows/Mac/Linux
  • alexus

    I'm looking to get a USB to Serial cable for my Mac/Win/Linux preferably small in size and without unnecessary software installations. I've had one a while ago, it would only work with Windows. On my Mac I can just plug any USB printer or scanner and it'd just work without installing anything, so that's what I want in that USB to Serial. can someone suggest me one?


  • Related Answers
  • Troggy

    http://www.amazon.com/Keyspan-Speed-Serial-Adapter-USA-19HS/dp/B0000VYJRY/ref=sr_1_2?ie=UTF8&s=electronics&qid=1249590051&sr=1-2

    This is the best one out there when is comes to mac compatibility. It does require some software installation though.

    It states on the amazon site linux and windows compatibility.

    It is the best for os x because of the driver support and ease of use. Every GPS owner and os x I know has always come back to this adapter for serial support. I'm sure this translates for other uses as well. There are other options out there for os x, but this one has the best support and drivers. Plus, it supports all the major OS's.

  • The Tentacle

    For very high performance, low latency support FTDI usb-serial have been verified as solid on OS X. Just do a search to find numerous options. The performance measurements came from the developer of a scientific toolbox for matlab who verified sub-millisecond precision.

    Startec also make reliable usb-serial cables with OS X drivers:

    http://www.startech.com/item/ICUSB232PRO-USB-to-RS-232-Serial-DB9-Adapter-with-COM-Retention.aspx