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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Operating system location (drive letter)

Operating system location (drive letter)

Scheduled Pinned Locked Moved C / C++ / MFC
agentic-aihardwarequestion
4 Posts 3 Posters 1 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
    FloatingMarc
    wrote on last edited by
    #1

    Hi, Is there a function that will tell me on wich drive the OS (Windows) is installed? I need this to perform a license check because not everyone has its OS installed on the C drive. And related to that: for the license check I use the volume information of the drive. In understand that it is different from the hardware ID of the drive, but how often do people reformat the drive where the OS is installed? I guess it is about as often as a drive would crash (well, maybe a little bit more), so that tells me the volume information check should be good enough for a license check. Am I doing something wrong in my reasoning, or did I forget something? I also understand that the volume id of a drive can be programmatically changed, but has this feature ever been used to override a license check? Any input is appreciated, thanks!

    P D 2 Replies Last reply
    0
    • F FloatingMarc

      Hi, Is there a function that will tell me on wich drive the OS (Windows) is installed? I need this to perform a license check because not everyone has its OS installed on the C drive. And related to that: for the license check I use the volume information of the drive. In understand that it is different from the hardware ID of the drive, but how often do people reformat the drive where the OS is installed? I guess it is about as often as a drive would crash (well, maybe a little bit more), so that tells me the volume information check should be good enough for a license check. Am I doing something wrong in my reasoning, or did I forget something? I also understand that the volume id of a drive can be programmatically changed, but has this feature ever been used to override a license check? Any input is appreciated, thanks!

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Environment variable SystemRoot=C:\WINDOWS If it's good enough for you, don't let anyone else tell you different.

      1 Reply Last reply
      0
      • F FloatingMarc

        Hi, Is there a function that will tell me on wich drive the OS (Windows) is installed? I need this to perform a license check because not everyone has its OS installed on the C drive. And related to that: for the license check I use the volume information of the drive. In understand that it is different from the hardware ID of the drive, but how often do people reformat the drive where the OS is installed? I guess it is about as often as a drive would crash (well, maybe a little bit more), so that tells me the volume information check should be good enough for a license check. Am I doing something wrong in my reasoning, or did I forget something? I also understand that the volume id of a drive can be programmatically changed, but has this feature ever been used to override a license check? Any input is appreciated, thanks!

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

        FloatingMarc wrote:

        Is there a function that will tell me on wich drive the OS (Windows) is installed?

        Check out GetWindowsDirectory() or SHGetFolderPath(CSIDL_WINDOWS).

        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

        "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

        F 1 Reply Last reply
        0
        • D David Crow

          FloatingMarc wrote:

          Is there a function that will tell me on wich drive the OS (Windows) is installed?

          Check out GetWindowsDirectory() or SHGetFolderPath(CSIDL_WINDOWS).

          "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

          "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

          F Offline
          F Offline
          FloatingMarc
          wrote on last edited by
          #4

          Thanks for the information to both of you!

          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