CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Posts
    148

    Hard disk Serial Number

    Hi All,

    I am trying to read the Physical Hard disk serial number(Not the volume serial number) which remains unchanged on formatting.

    I have tried WMI as well as DeviceIOControl API as unmanaged code but it returns wrong serial number.

    I have tried on the various OS and Hard disks, some of the results are as follows.

    1. Win7 Professional Version - characters pairs are transposed like if Actual serial number is 3RGB9087P then the returned number is 3 GR9B80P7

    2. On Win 7 Ultimate version it return as series of string like 2020202020202020207BB3674FQW09

    The same thing occurs on Vista 32 bit and 64 bit.

    Also under different user credentials results are different.

    On win xp only, i have got correct result.

    I have searched so many examples from different sites but the results are wrong.

    Is there any standard way to do it.

    Thanx for any kind of help,

    Regards,

  2. #2
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,016

    Re: Hard disk Serial Number

    It looks like there has been a very similar question over at StackOverflow:

    http://stackoverflow.com/questions/5...-or-hard-drive

    Did those solutions not resolve your problem?
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  3. #3
    Join Date
    Jun 2006
    Posts
    148

    Re: Hard disk Serial Number

    [QUOTE=BioPhysEngr;2071340]It looks like there has been a very similar question over at StackOverflow:

    Already tried without success.
    Results are as mentioned.

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured