views:

31

answers:

1

Hi,

I need to find the underlying disk capacity (total size) of an unmapped network share in windows (in Win7, Vista, XP, Server 2008), given a UNC path (e.g. given something like "\\share_1\subdir").

I've looked all over the web for several days and seem to find no answer to this issue. I would appreciate any leads. Thanks in advance for your time!

I would have given up by now, if it weren't for the ability to find the underlying free space of unmapped network shares, using the "GetDiskFreeSpaceEx()" Win32 function. I imagine that disk capacity is stored in a similar fashion to free space, hence retrieving it would be very similar (hence I'm somewhat infuriated with MS for not making the functionality obvious, or myself for not being able to find it thus far!)

Regards,

vivri

A: 

You are on the right track. GetDiskFreeSpaceEx will also display capacity, you just have to call the correct members.

See this Microsoft support link on how to do it.

Keep in mind that GetDiskFreeSpaceEx may only retrieve the free disk space by user. For instance, Windows Explorer uses GetDiskFreeSpaceEx also and it may not report the actual free physical disk space, but rather the user's logged in quota.

0A0D
There's probably a performance counter that will give the true free space.
Michael J
Thanks, this works. I completely glanced over the other arguments..
vivri