Is there a way to get the amount of free diskspace of a disk or a folder in a CMD
without having to install some thirdparty applications?
I have a CMD that copies a big file to a given directory and could of course use
the errorlevel return from the copy command, but then I have to wait for the time
it takes to copy the file (eg…to that then the disk is full and the copy operation fails).
I would like to know before I start the copy if it is any idea at all. Tried the DU.EXE utility from Sysinternals, but that show occupied space only.
Best Solution
If you run "
dir c:\
", the last line will give you the free disk space.Edit: Better solution: "
fsutil volume diskfree c:
"