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. PhysicalDriveX

PhysicalDriveX

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
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.
  • M Offline
    M Offline
    Mila025
    wrote on last edited by
    #1

    Hello, Short question: How to get physical drive number, where specify volume letter i.e. C: is assigned ? any idea ? Mila

    K 1 Reply Last reply
    0
    • M Mila025

      Hello, Short question: How to get physical drive number, where specify volume letter i.e. C: is assigned ? any idea ? Mila

      K Offline
      K Offline
      khan
      wrote on last edited by
      #2

      int a; a = PathGetDriveNumber("c:\\"); You also need to include "shlwapi.h" and link with shlwapi.lib this is this.

      M 1 Reply Last reply
      0
      • K khan

        int a; a = PathGetDriveNumber("c:\\"); You also need to include "shlwapi.h" and link with shlwapi.lib this is this.

        M Offline
        M Offline
        Mila025
        wrote on last edited by
        #3

        Not that fast ;) This function returns ... quote: "0 through 25 (corresponding to 'A' through 'Z') if the path has a drive letter, or -1 otherwise" In fact, returned value corresponds an logical drive number and doesn't correspond with physical drive number. Mila

        K 1 Reply Last reply
        0
        • M Mila025

          Not that fast ;) This function returns ... quote: "0 through 25 (corresponding to 'A' through 'Z') if the path has a drive letter, or -1 otherwise" In fact, returned value corresponds an logical drive number and doesn't correspond with physical drive number. Mila

          K Offline
          K Offline
          khan
          wrote on last edited by
          #4

          I remembered it the moment I had hit the submit button. :) You could still get all the drives in the system, and check if it is a logical or physical drive, maybe. this is this.

          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