代码进行批处理文件检查HDD空间,仅在30GB或更多可用时运行
我有一个用于备份的脚本。
目前,如果没有足够的空间,并且报告一切都很好,则不会出错。
有什么方法可以在开始时添加存储检查,并且只有超过30GB是免费的。 如果没有,则错误。
我宁愿使用CMD而不是PowerShell
I have a script that I use for backing up.
Currently it does not error if there isn't enough space and reports everything was fine.
Is there a way I can add a storage check at the start and only allow it to run if over 30gb is free.
Then error if not.
I'd rather use cmd than powershell
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用“
fsutil卷Diskfree C:
”以获取驱动器上的大小,请使用“set
”使其变量,并将其比较30Edit:
替代方案是“
dir |查找”字节免费“
”Use "
fsutil volume diskfree c:
" to get size left on drive, make it a variable using "set
" and compare it to 30EDIT:
Alternative is "
dir|find "bytes free"
"