Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Hard Drive, BIOS and CPU serial number in VC++ 6.0?

Hard Drive, BIOS and CPU serial number in VC++ 6.0?

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadminhelpquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Freddie Code
    wrote on last edited by
    #1

    In VB 6.0 I use the following code to get the hard drive serial number. Is there an equivalent method in VC++ 6.0? How about a way to get the BIOS or CPU serial number? Could not find it in the help menu. A code snip would be really helpful. Thanks! Sub ShowDriveInfo(drvpath) Dim fs, d, s, t Set fs = CreateObject("Scripting.FileSystemObject") Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath))) Select Case d.DriveType Case 0: t = "Unknown" Case 1: t = "Removable" Case 2: t = "Fixed" Case 3: t = "Network" Case 4: t = "CD-ROM" Case 5: t = "RAM Disk" End Select s = "Drive " & d.DriveLetter & ": - " & t s = s & vbCrLf & "SN: " & d.SerialNumber MsgBox s End Sub

    M D D 3 Replies Last reply
    0
    • F Freddie Code

      In VB 6.0 I use the following code to get the hard drive serial number. Is there an equivalent method in VC++ 6.0? How about a way to get the BIOS or CPU serial number? Could not find it in the help menu. A code snip would be really helpful. Thanks! Sub ShowDriveInfo(drvpath) Dim fs, d, s, t Set fs = CreateObject("Scripting.FileSystemObject") Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath))) Select Case d.DriveType Case 0: t = "Unknown" Case 1: t = "Removable" Case 2: t = "Fixed" Case 3: t = "Network" Case 4: t = "CD-ROM" Case 5: t = "RAM Disk" End Select s = "Drive " & d.DriveLetter & ": - " & t s = s & vbCrLf & "SN: " & d.SerialNumber MsgBox s End Sub

      M Offline
      M Offline
      Milton Karimbekallil
      wrote on last edited by
      #2

      hi Use GetDriveType API and c the 'See also' section in MSDN 4 related info. rgds..mil10

      1 Reply Last reply
      0
      • F Freddie Code

        In VB 6.0 I use the following code to get the hard drive serial number. Is there an equivalent method in VC++ 6.0? How about a way to get the BIOS or CPU serial number? Could not find it in the help menu. A code snip would be really helpful. Thanks! Sub ShowDriveInfo(drvpath) Dim fs, d, s, t Set fs = CreateObject("Scripting.FileSystemObject") Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath))) Select Case d.DriveType Case 0: t = "Unknown" Case 1: t = "Removable" Case 2: t = "Fixed" Case 3: t = "Network" Case 4: t = "CD-ROM" Case 5: t = "RAM Disk" End Select s = "Drive " & d.DriveLetter & ": - " & t s = s & vbCrLf & "SN: " & d.SerialNumber MsgBox s End Sub

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Freddie Code wrote: Is there an equivalent method in VC++ 6.0? See here. Freddie Code wrote: How about a way to get the BIOS or CPU serial number? Use the Win32_BIOS and Win32_Processor classes respectively.


        "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

        1 Reply Last reply
        0
        • F Freddie Code

          In VB 6.0 I use the following code to get the hard drive serial number. Is there an equivalent method in VC++ 6.0? How about a way to get the BIOS or CPU serial number? Could not find it in the help menu. A code snip would be really helpful. Thanks! Sub ShowDriveInfo(drvpath) Dim fs, d, s, t Set fs = CreateObject("Scripting.FileSystemObject") Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath))) Select Case d.DriveType Case 0: t = "Unknown" Case 1: t = "Removable" Case 2: t = "Fixed" Case 3: t = "Network" Case 4: t = "CD-ROM" Case 5: t = "RAM Disk" End Select s = "Drive " & d.DriveLetter & ": - " & t s = s & vbCrLf & "SN: " & d.SerialNumber MsgBox s End Sub

          D Offline
          D Offline
          Darshan Jani
          wrote on last edited by
          #4

          You can use Windows Management Instrumentation (WMI) SDK for all H/W information you need. Use Win32_Processor,etc Classes. Regards, Darshan Jani

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups