Question : GetDiskFreeSpaceEx with UNC

Hello,

I have a problem to receive the free disk space with an UNC path.
Like "\\HPOne\Video\Temp\" reports allways -1 if I try to call it with GetDiskFreeSpaceEx.
A nornal "C:\Test\" works fine. Any Idea? MSDN states that it will work with UNC.

Ocrana

Answer : GetDiskFreeSpaceEx with UNC

First, make sure it works from the command line: DIR \\HPOne\Video\Temp\

Next, check GetLastError(). (In the debugger, you can view the result of GetLastError() using the special constant @ERR) My guess is that you are getting ERROR_ACCESS_DENIED or ERROR_PATH_NOT_FOUND.

If you are getting ERROR_PATH_NOT_FOUND, try removing the trailing backslash.
Random Solutions  
 
programming4us programming4us