Category filter

Script to check available disk space on Windows

Low disk space on a device is a significant issue that can negatively impact the performance and productivity of the endpoints. Administrators would want to keep track of the available disk space on a device to check if a required amount of space is present, for instance, to push major OS updates or other company files/resources. Close monitoring of disk spaces is sometimes required to identify any disks that might be clogged with unwanted cache and files. Hexnode UEM lets admins check for the available disk space on Windows devices using custom scripts.

Disclaimer:

The sample scripts provided below are adapted from third-party open-source sites.

Batch script

Displays the available space in the memory drive

This script displays the available disk space in GB.

PowerShell script

List of all drives and their available space

This script displays the drive name, available disk space, used space, and the percentage of free space available.

Notes:

  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository