CMD shell 中的可用空间 [英] Free space in a CMD shell
问题描述
有没有办法在 CMD 中获取磁盘或文件夹的可用磁盘空间量无需安装某些第三方应用程序?
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?
我有一个将大文件复制到给定目录的 CMD,当然可以使用从复制命令返回的错误级别,但是我必须等待时间需要复制文件(例如...到那个时候磁盘已满并且复制操作失败).
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).
我想在开始复制之前知道是否有任何想法.尝试了 Sysinternals 的 DU.EXE 实用程序,但仅显示已占用空间.
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.
推荐答案
如果你运行dir c:
",最后一行会给你可用的磁盘空间.
If you run "dir c:
", the last line will give you the free disk space.
更好的解决方案:fsutil volume diskfree c:
"
这篇关于CMD shell 中的可用空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!