Try being more specific. What operating system, what do you mean by "registration numbers"?

For example, you can query a drive on capabilities and vendor strings under Linux with the hdparm command:

# hdparm -i /dev/hda /dev/hda: Model=WDC WD307AA-00BAA0, FwRev=10.09K11, SerialNo=WD-WMA2F2556865 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGap +Req } RawCHS=16383/16/63, TrkSize=57600, SectSize=600, ECCbytes=40 BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=1 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=60074784 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120} PIO modes: pio0 pio1 pio2 pio3 pio4 DMA modes: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4 AdvancedPM=no WriteCache=enabled Drive Supports : Reserved : ATA-1 ATA-2 ATA-3 ATA-4

And if the serial number is what you're looking for, here's a Perl script to extract it:

#!/usr/bin/perl my $query = qx{hdparm -i /dev/hda} or die $!; print "HDD serial number is: $1\n" if $query =~ m/SerialNo=([^,\s]+)/s;

The output on my system is:

HDD serial number is: WD-WMA2F2556865


In reply to Re: Can Perl read the hard drive registration #? by calin
in thread Can Perl read the hard drive registration #? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.