locked
how to find out free space for logical drives?

    Question

  • Hi all,<o:p></o:p>

    I am trying to get my hard disk free space for my application using windows store app, so i
    begun with GetDiskFreeSpaceEx(), But unfortunately this wrapper only returns
    for specfic drive(Primary partition eg.c:\) not for all the logical Partitions
    available in the system. So Please let me know how to find out free space for
    all the drives.<o:p></o:p>

    Note: I am passing first parameter(path) like this:<o:p></o:p>

    GetDiskFreeSpaceEx(L"C:\\Users\\test\\AppData\\Local\\Packages\\41fce545-5052-41a8-b99c-3fb142718c5e_yps\\LocalState\\temp.txt",,,);<o:p></o:p>

    Regards,<o:p></o:p>

    Muthu<o:p></o:p>


    Wednesday, July 10, 2013 12:09 PM

All replies

  • I'm not sure what you mean by being unable to find all the logical partitions. GetDiskFreeSpaceEx should be able to target any directory. Can you provide clearer details on the scenario which fails and the error that is returned?

    Your app will need to have sufficient privileges to list the directory.

    --Rob

    Thursday, July 11, 2013 2:37 AM
    Owner
  • Hi Rob,

    If I try to access C,D drive like below I am getting "Access Denied Error"

    GetDiskFreeSpaceEx(L"C:\\",,,) or  GetDiskFreeSpaceEx(L"D:\\",,,).

    That's what the reason i specified like below

    GetDiskFreeSpaceEx(L"C:\\Users\\test\\AppData\\Local\\Packages\\41fce545-5052-41a8-b99c-3fb142718c5e_yps\\LocalState\\",,,);

    I don't have privilege to access these drives. So I am looking for alternate solution which satify my problem.

    Regards,

    Muthu


    • Edited by Muthazhagan Thursday, July 11, 2013 3:11 AM sentance correction
    Thursday, July 11, 2013 3:10 AM