My short research for "get free disk space windows c++" with Google gave me the
GetDiskFreeSpace function with returns the amount of free space.
That should be the starting point of calculating the optimal file set for your copy job.
And guess: to copy a file you can use
CopyFile.
Consider learning the powerful C++ language and the Windows API. ;-)