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 disk serial number in vista

hard disk serial number in vista

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++json
4 Posts 2 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.
  • V Offline
    V Offline
    viral_umang hotmail com
    wrote on last edited by
    #1

    i am not able to get hard disk serial number in vista. i want code that can be used in vc++ 6.0 and should be able to run in vista. i don't want to use wmi or .net framwork and without administrator login as my software can run form win95,98,me to vista. my software is not useing any api of .net. viral joshi

    B 1 Reply Last reply
    0
    • V viral_umang hotmail com

      i am not able to get hard disk serial number in vista. i want code that can be used in vc++ 6.0 and should be able to run in vista. i don't want to use wmi or .net framwork and without administrator login as my software can run form win95,98,me to vista. my software is not useing any api of .net. viral joshi

      B Offline
      B Offline
      bob16972
      wrote on last edited by
      #2

      viral_umang@hotmail.com wrote:

      i don't want to use wmi

      Unfortunately, WMI is the easiest way to go when it comes to getting hardware information. There is a WMI redistributable for Win95, Win98, and WinNT that you can package up in an msi along with your app. The read-only side of WMI works great when logged on as a regular user (non-admin). I program with it in Visual C++ 6.0 (Platform SDK is required on your Visual C++ 6.0 machine) and it works fine on Vista. Now, I agree with you on the "no dotNet stuff" and WMI is quite complex since it is DCOM based but it hasn't weighed me down too much since the queries are always on the same box. DCOM seems heavy only when you try to do stuff remotely. There are just too many variables involved with trying to write your own code for every possible piece of hardware out there that may be underneath any Win95-Vista installation for even the most conservative programmer. If you've never programmed in COM or DCOM, then I might understand any hesitation or reluctance since the initial learning curve is substantial in Visual C++ but if your a veteran COM programmer, this is one of those rare instances where I'd have to ask "Why not give it a try?". Once you write the code for one property, you can reuse that code for most others.

      V 1 Reply Last reply
      0
      • B bob16972

        viral_umang@hotmail.com wrote:

        i don't want to use wmi

        Unfortunately, WMI is the easiest way to go when it comes to getting hardware information. There is a WMI redistributable for Win95, Win98, and WinNT that you can package up in an msi along with your app. The read-only side of WMI works great when logged on as a regular user (non-admin). I program with it in Visual C++ 6.0 (Platform SDK is required on your Visual C++ 6.0 machine) and it works fine on Vista. Now, I agree with you on the "no dotNet stuff" and WMI is quite complex since it is DCOM based but it hasn't weighed me down too much since the queries are always on the same box. DCOM seems heavy only when you try to do stuff remotely. There are just too many variables involved with trying to write your own code for every possible piece of hardware out there that may be underneath any Win95-Vista installation for even the most conservative programmer. If you've never programmed in COM or DCOM, then I might understand any hesitation or reluctance since the initial learning curve is substantial in Visual C++ but if your a veteran COM programmer, this is one of those rare instances where I'd have to ask "Why not give it a try?". Once you write the code for one property, you can reuse that code for most others.

        V Offline
        V Offline
        viral_umang hotmail com
        wrote on last edited by
        #3

        hi thanks for the reply my code is working fine upto winxp. but i am not able to get same info in vista. it return blank. i am able find out wich os is runing and base on i can call that function. that is ok. just i want what are the change in vista to get hdd serial number. if i include wmi with my app. deploment set get big as it include complet wmi and i want only one info i.e. hdd serial no. so it would be not good just to include whole stuff in my deploment setup. this is same case with dotnet framework. that is why i want to write this code i my app. thank you

        B 1 Reply Last reply
        0
        • V viral_umang hotmail com

          hi thanks for the reply my code is working fine upto winxp. but i am not able to get same info in vista. it return blank. i am able find out wich os is runing and base on i can call that function. that is ok. just i want what are the change in vista to get hdd serial number. if i include wmi with my app. deploment set get big as it include complet wmi and i want only one info i.e. hdd serial no. so it would be not good just to include whole stuff in my deploment setup. this is same case with dotnet framework. that is why i want to write this code i my app. thank you

          B Offline
          B Offline
          bob16972
          wrote on last edited by
          #4

          Fair enough. What method are you using to obtain HDD Serial number as it might help understand what might be stopping it? Just to see if it's related to UAC, have you disabled UAC temporarily while trying your code to see if it works. I'm not sure how that could affect code that normally runs as "user" but Vista has been throwing some pretty mean curveballs my way the last few weeks so it might not be a bad idea to try that. If you go to administrative tools, Local Security Policy, Local Policies, Security Options, and scroll to the "User Account Control:" settings and disable them (Just for testing) and try what you are trying and it works, then you found the culprit(s). You may need to logoff/logon or restart to get the new settings to apply.

          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