Try using _getdiskfree function defined in dos.h which populates the structure _diskfree_t