I need to get the free space of a Network drive, without "map drive"
DriveInfo drvInfo = new DriveInfo("\\NetworkDrive");
I try to do this but it does not work.
How to check the available disk space / usage. In windows explorer, browse to the network share, then to the folder that you want to check the disk usage, right client on the folder and select properties. In the properties window, click on the "OES Info" tab, and check the "Space Available" field.
Go to File Explorer, and go to "This PC". Look for your default hard drive, which by default is (C:), and from there you can check your total space, and how much you have used.
Search command prompt in Windows 10, and right-click on the result and choose Run as administrator. Step 2. Type wmic diskdrive get size and press Enter. Finally, the total size of hard disk space (in pure number) is displayed in the figure below.
I believe you will need to call GetDiskFreeSpace
(Win32 API) via P/Invoke to get the disk free space of a UNC network drive.
e.g.
C# GetDiskFreeSpace UNC
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With