|
acme
中级用户
  
积分 238
发帖 98
注册 2007-4-10 来自 陕西
状态 离线
|
『楼 主』:
可以使用dos命令获得磁盘剩余空间吗?
使用 LLM 解释/回答一下
可以使用dos命令获得磁盘剩余空间吗?
各位大哥:dos能做到吗?;)
Can DOS commands be used to obtain the remaining disk space?
Dear brothers: Can DOS do it? ; )
|
|
2007-4-11 20:42 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
|
2007-4-11 22:19 |
|
|
acme
中级用户
  
积分 238
发帖 98
注册 2007-4-10 来自 陕西
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
dir/c可以显示出来;
但是我是想将剩余空间大小作为一个判断条件。、
dir/c可以将剩余大小的值=a吗?
set a=%dir/c%
行吗?
The remaining space size can be displayed with dir/c; but I want to use the remaining space size as a judgment condition. Can dir/c assign the value of the remaining size to =a? set a=%dir/c% Is that okay?
|

一切皆有可能!我行!我能! |
|
2007-4-12 12:40 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
|
2007-4-12 14:10 |
|
|
acme
中级用户
  
积分 238
发帖 98
注册 2007-4-10 来自 陕西
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
我说的目的是想达成,在d盘剩余空间小于500MB时删除d盘中建立最早的2gb资料。
大哥们觉得通过*.bat可以实现吗?
《如果问题很幼稚,各位不要见笑,我是新手!》
The purpose I mentioned is to achieve that when the free space on drive D is less than 500MB, delete the earliest 2GB of data created in drive D. Brothers, do you think it can be achieved through a *.bat?
"Don't laugh if the problem is naive, I'm a newbie!"
|

一切皆有可能!我行!我能! |
|
2007-4-12 21:07 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
新手并不可笑,但如果新手不认真学习以前的讨论内容就不断的提问题就不太好了。
你的问题并不复杂,应该比较容易解决,我可以提示你用for命令提取出相关的值来进行判断,或者使用wmic命令:
wmic logicaldisk list brief
Newcomers are not ridiculous, but it is not good if newbies keep asking questions without seriously studying previous discussion content.
Your question is not complicated and should be relatively easy to solve. I can suggest that you use the for command to extract relevant values for judgment, or use the wmic command:
wmic logicaldisk list brief
此帖被 +1 点积分 点击查看详情 评分人:【 acme 】 | 分数: +1 | 时间:2007-4-13 08:48 |
|
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2007-4-12 21:31 |
|
|
bjsh
银牌会员
    
积分 2000
发帖 621
注册 2007-1-1
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
wmic logicaldisk where deviceID="c:" get FreeSpace |more +1
其他盘自行更改其中的c:为其他盘
wmic logicaldisk where deviceID="c:" get FreeSpace |more +1
Change the c: in it to other drives for other drives
此帖被 +1 点积分 点击查看详情 评分人:【 acme 】 | 分数: +1 | 时间:2007-4-13 08:48 |
|
|
|
2007-4-12 22:57 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
如果是要在纯DOS下:
1
用第三方 get K ,但好象只能支持最大2G
2
用第三方 LMOD, 分析DIR 的结果, 没有2G限制
dir C:\ /w/ahd | find " free" | lmod /s set freesize=[$!-2] [$!-1][-]>freesize.bat
call freesize
If it is under pure DOS:
1
Use a third-party get K, but it seems to only support up to 2GB
2
Use a third-party LMOD, analyze the result of DIR, no 2GB limit
dir C:\ /w/ahd | find " free" | lmod /s set freesize= >freesize.bat
call freesize
此帖被 +2 点积分 点击查看详情 评分人:【 acme 】 | 分数: +2 | 时间:2007-4-13 08:47 |
|
|
|
2007-4-12 23:48 |
|
|
airosp
初级用户
 
积分 99
发帖 41
注册 2007-2-19
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
用diskpart也不错~
Using diskpart is also good~
|

量子公民 |
|
2007-4-12 23:56 |
|
|
acme
中级用户
  
积分 238
发帖 98
注册 2007-4-10 来自 陕西
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
可以详细指点一下吗?
如何将他用语条件判断中?
谢谢!
Can you give a detailed explanation? How to use him in the conditional judgment? Thanks!
|

一切皆有可能!我行!我能! |
|
2007-4-13 08:49 |
|
|
bjsh
银牌会员
    
积分 2000
发帖 621
注册 2007-1-1
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
for /f %%a in ('wmic logicaldisk where deviceID="c:" get FreeSpace |more +1') do if "%%a" geq ......
for /f %%a in ('wmic logicaldisk where deviceID="c:" get FreeSpace ^|more +1') do if "%%a" geq ......
此帖被 +1 点积分 点击查看详情 评分人:【 acme 】 | 分数: +1 | 时间:2007-4-17 20:57 |
|
|
|
2007-4-13 10:04 |
|
|
acme
中级用户
  
积分 238
发帖 98
注册 2007-4-10 来自 陕西
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
谢谢了,如果验证ok再来谢谢指导者。
Thanks. If the verification is okay, I'll come back later to thank the guide.
|

一切皆有可能!我行!我能! |
|
2007-4-13 20:41 |
|
|
acme
中级用户
  
积分 238
发帖 98
注册 2007-4-10 来自 陕西
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
我试验了很多都是无法实现,哪位高手可以说明详细一点吗?
我要实现的就是:
如果d盘的空间小于1GB了就自动删除建立时间最早的2个资料夹。
I tried many things and none worked. Can any expert explain it in detail?
What I want to achieve is:
If the space on drive D is less than 1GB, automatically delete the 2 folders with the earliest creation time.
|

一切皆有可能!我行!我能! |
|
2007-4-17 08:56 |
|
|
acme
中级用户
  
积分 238
发帖 98
注册 2007-4-10 来自 陕西
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
大哥,你给注意吧。
Dude, please pay attention.
|

一切皆有可能!我行!我能! |
|
2007-4-17 20:57 |
|
|
a25969805
新手上路

积分 5
发帖 3
注册 2006-12-29
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
@echo off
set driver=e
for /f "tokens=1-10 delims=, " %%a in ('dir %driver%: ^| find "可用字节"') do set c=%%c
for /f "tokens=1-10 delims=, " %%a in ('dir %driver%: ^| find "可用字节"') do set d=%%d
for /f "tokens=1-10 delims=, " %%a in ('dir %driver%: ^| find "可用字节"') do set e=%%e
for /f "tokens=1-10 delims=, " %%a in ('dir %driver%: ^| find "可用字节"') do set f=%%f
for /f "tokens=1-10 delims=, " %%a in ('dir %driver%: ^| find "可用字节"') do set g=%%g
for /f "tokens=1-10 delims=, " %%a in ('dir %driver%: ^| find "可用字节"') do set h=%%h
echo %d% | find "字节" >nul
if %ERRORLEVEL% neq 0 goto nexte
set space=%c%
:nexte
echo %e% | find "字节" >nul
if %ERRORLEVEL% neq 0 goto nextf
set space=%c%%d%
set /a space=%space%/1024/1024
:nextf
echo %f% | find "字节" >nul
if %ERRORLEVEL% neq 0 goto nextg
set space=%c%%d%%e%
set /a space=%space%/1024/1024
:nextg
echo %g% | find "字节" >nul
if %ERRORLEVEL% neq 0 goto nexth
set space=%d%%e%%f%
set /a space=%space%/1024/1024
set t=%c%
set /a t=%t%*953
set /a space=%space%+%t%
:nexth
echo %h% | find "字节" >nul
if %ERRORLEVEL% neq 0 goto nextx
set space=%c%%d%%e%%f%%g%
set space=%d%%e%%f%
set /a space=%space%/1024/1024
set t=%c%%d%
set /a t=%t%*953
set /a space=%space%+%t%
:nextx
echo %driver%:=%space%M___FREE
echo 按任意键退出... && pause>nul
@echo off
set driver=e
for /f "tokens=1-10 delims=, " %%a in ('dir %driver%: ^| find "Available bytes"') do set c=%%c
for /f "tokens=1-10 delims=, " %%a in ('dir %driver%: ^| find "Available bytes"') do set d=%%d
for /f "tokens=1-10 delims=, " %%a in ('dir %driver%: ^| find "Available bytes"') do set e=%%e
for /f "tokens=1-10 delims=, " %%a in ('dir %driver%: ^| find "Available bytes"') do set f=%%f
for /f "tokens=1-10 delims=, " %%a in ('dir %driver%: ^| find "Available bytes"') do set g=%%g
for /f "tokens=1-10 delims=, " %%a in ('dir %driver%: ^| find "Available bytes"') do set h=%%h
echo %d% | find "bytes" >nul
if %ERRORLEVEL% neq 0 goto nexte
set space=%c%
:nexte
echo %e% | find "bytes" >nul
if %ERRORLEVEL% neq 0 goto nextf
set space=%c%%d%
set /a space=%space%/1024/1024
:nextf
echo %f% | find "bytes" >nul
if %ERRORLEVEL% neq 0 goto nextg
set space=%c%%d%%e%
set /a space=%space%/1024/1024
:nextg
echo %g% | find "bytes" >nul
if %ERRORLEVEL% neq 0 goto nexth
set space=%d%%e%%f%
set /a space=%space%/1024/1024
set t=%c%
set /a t=%t%*953
set /a space=%space%+%t%
:nexth
echo %h% | find "bytes" >nul
if %ERRORLEVEL% neq 0 goto nextx
set space=%c%%d%%e%%f%%g%
set space=%d%%e%%f%
set /a space=%space%/1024/1024
set t=%c%%d%
set /a t=%t%*953
set /a space=%space%+%t%
:nextx
echo %driver%:=%space%M___FREE
echo Press any key to exit... && pause>nul
|
|
2007-4-24 23:09 |
|