Category filter

Scripts to get the size of all items in a specific folder in Windows

Users can now get information about the size of files stored in a specific folder on their Windows 10/11 endpoint devices by deploying scripts via Hexnode UEM console.

Disclaimer:

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

Batch script

Specify the path of the folder and run the script to get a list of items in that folder with their respective file sizes (in bytes). While parameter /a is used to display every file, including system and hidden files, parameter /s lists the files in the specified directory and all the sub directories within that directory. The total size of the folder is also returned.

PowerShell script

The script returns the name and size of all files (in KB) present in the specified folder.

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