how can i write vbscript that calculates the free space in C: drive of a windows machine
To check the total disk space left on your Windows 10 device, select File Explorer from the taskbar, and then select This PC on the left. The available space on your drive will appear under Devices and drives.
At least 7.5 GB of free disk storage for a typical installation. 60 MB in the temporary directory space. 2 GB partition size in the C:\ drive.
As you fill the SSD, to less than 10% available, it can completely thrash your performance. Also, with how SSD's move data around to balance performance with endurance, filling the drive can decrease your drive's life expectancy. For near optimal performance, ~50% available.
To expand system partition (C: driver) size Before expanding C drive size, need to confirm there is unallocated space next to C drive. Right click on C drive then select “Extend volume”, then follow the onscreen instruction to finish the process.
have a look at this page:
Set objWMIService = GetObject("winmgmts:")
Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='c:'")
Wscript.Echo objLogicalDisk.FreeSpace
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