Get free disk space in percent from command line

This command can be run from a CMD prompt to get the percentage of free disk space on the C:\ drive:

You can even run this in a task sequence command line step and save the value in a task sequence variable.

This is useful if you want to create a condition on a subsequent task sequence step used for preparing a computer for BitLocker.

The BDEHDCFG.exe tool needs at least 10% free disk space, in order to create a boot partition as shown below:

I used this to enable Bitlocker on computer clients in production which for one reason or another hadn’t been encrypted with BitLocker.


Share your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.