Results 1 to 5 of 5

Thread: Hard Drive Real Serial Number

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    99

    Angry Hard Drive Real Serial Number

    PHP Code:
      Dim searcher As ManagementObjectSearcher = New ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia")
            For 
    Each wmi_HD As ManagementObject In searcher.Get()
                
    MessageBox.Show(wmi_HD("SerialNumber"))
            
    Next 

    iam using this code for getting hard drive serial number its works ok with me but not working on my friends system and return an empty string any help plz

  2. #2
    Hyperactive Member
    Join Date
    Dec 2006
    Posts
    293

    Re: Hard Drive Real Serial Number

    What OS's are your friends using?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    99

    Re: Hard Drive Real Serial Number

    Quote Originally Posted by crampz View Post
    What OS's are your friends using?
    its windows xp

  4. #4
    Hyperactive Member
    Join Date
    Dec 2006
    Posts
    293

    Re: Hard Drive Real Serial Number

    Quote Originally Posted by hackerspk View Post
    its windows xp
    Its just that, i was reading other threads and wmi function doesn't work under XP or doesnt work well. I can't seem to find the threads now, but im pretty sure.

  5. #5
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Hard Drive Real Serial Number

    There is no problem on Win32_Physical media i'm aware of.
    The problem is on Win32_DiskDrive.serialnumber that needs Vista and above
    Here is a thread that i provide both API and WMI and there is also code for Win32_PhysicalMedia.Since i have xp and vs 2003 here i tested to be sure and everything works except Win32_DiskDrive. If you need to go with XP also then you must settle for a unique but not the exact serial number or API for a unique number.
    http://www.vbforums.com/showthread.php?t=606257
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

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