We help IT Professionals succeed at work.

GetDiskFreeSpaceEx with UNC

Ocrana
Ocrana used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
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.

Author

Commented:
Ok, last Error is PATH_NOT_FOUND. But this makes no sense cause "\\HPOne\Video\Temp\" is exact what the FileOpen Dialog will return. ALso removing the backlash do not work.
So what is wrong that the system report a pat string but next time said it is invalid (not found)?

Ocrana