|
mp3down
初级用户
 
积分 43
发帖 14
注册 2006-12-9
状态 离线
|
『楼 主』:
如何判断D盘的剩余空间是否大于1G?
使用 LLM 解释/回答一下
请问: 如何判断D盘的剩余空间是否大于1G? 谢谢.
Please: How to determine if the free space on drive D is greater than 1GB? Thank you.
|
|
2006-12-13 03:12 |
|
|
mp3down
初级用户
 
积分 43
发帖 14
注册 2006-12-9
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
补充: 要在纯DOS下能够正常运行,谢谢.
Supplement: It needs to run normally under pure DOS, thank you.
|
|
2006-12-13 03:34 |
|
|
yusir0710
新手上路

积分 6
发帖 2
注册 2006-11-18
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
@ECHO OFF
setlocal EnableDelayedExpansion
for /f "tokens=3" %%i in ('dir /-c D:\') do set freesize=%%i
set /a freesize=!freesize:~0,-6!/1024>nul
ECHO %freesize%
set /a 基准容量=1
PAUSE
IF %freesize% GTR %基准容量% goto gtr
ECHO 空间小于%基准容量%G
pause
exit
:gtr
ECHO 空间大于%基准容量%G
pause
Last edited by yusir0710 on 2006-12-18 at 02:37 AM ]
@ECHO OFF
setlocal EnableDelayedExpansion
for /f "tokens=3" %%i in ('dir /-c D:\') do set freesize=%%i
set /a freesize=!freesize:~0,-6!/1024>nul
ECHO %freesize%
set /a baseCapacity=1
PAUSE
IF %freesize% GTR %baseCapacity% goto gtr
ECHO The space is less than %baseCapacity%G
pause
exit
:gtr
ECHO The space is greater than %baseCapacity%G
pause
Last edited by yusir0710 on 2006-12-18 at 02:37 AM ]
|
|
2006-12-18 15:25 |
|
|
NaturalJ0
银牌会员
    
积分 1181
发帖 533
注册 2006-8-14
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
楼上这个是在 CMD 下用的,在纯 DOS 下不能用。
纯 DOS 下怎么判断我暂时还没想到。
The one upstairs is for use under CMD, and it can't be used in pure DOS. I haven't thought of how to judge in pure DOS for the time being.
|
|
2006-12-18 22:32 |
|
|
redtek
金牌会员
     
积分 2902
发帖 1147
注册 2006-9-21
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
这个有意思~:)
不知道mp3down兄在一些类似一键恢复盘等工具盘中是否找到了他们是用的什么方法?
汇编…36H 号功能调用可以取得空闲磁盘空间,然后用prompt方式操作Debug直接写汇编代码,这样可以不生成临时文件。
(另:上面方法是不调用第三方工具可以实现的)
( 然后继续在Debug里直接比对是否大于1G或是小于1G,调用4CH DOS功能将一个标置数返回给ERRORLEVEL 由批处理判断)
(理论上完全可以实现)
上面只是给兄的一个建议,我不会编~:)
兄可以发贴到论坛的 “DOS开发编程 & 发展交流 (开发室)” 问问直接Debug操作上面原理代码是什么,或许能解燃眉之急~:)
This is interesting~:)
I wonder if Brother mp3down has found out what method they used in some tools like one-click recovery disks?
Assembly... Function call 36H can obtain the free disk space, and then operate Debug with the prompt method to directly write assembly code, so that no temporary files can be generated.
(Another: The above method can be realized without calling third-party tools)
(Then continue to directly compare in Debug whether it is greater than 1G or less than 1G, call 4CH DOS function to return a flag number to ERRORLEVEL, and the batch processing will judge)
(Theoretically completely achievable)
The above is just a suggestion for you, I can't code~:)
Brother can post to the "DOS Development Programming & Development Exchange (Development Room)" in the forum to ask what the principle code of directly operating Debug above is, maybe it can solve the urgent problem~:)
|

Redtek,一个永远在网上流浪的人……
_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._ |
|
2006-12-19 02:38 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
GMY的一键GHOST,本身不判断保存备份的分区可用空间大小,而是在ghost出错时根据ghost生成的出错文件提供原因。
GMY's one-click GHOST does not itself judge the available space size of the partition where the backup is saved. Instead, it provides the reason based on the error file generated by GHOST when GHOST encounters an error.
|

Windows 一键还原
http://www.yjhy.com |
|
2006-12-19 02:49 |
|
|
lizaoyou
中级用户
  
积分 210
发帖 85
注册 2007-1-14 来自 广东广州
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
在dos下实现较繁,以下是使用批处理扩展strings.com的一个例子:
@echo off
echo.
set v=
dir d:\|find "free">tmp
strings s=read tmp,1
strings/p- s=mid %s%-9
strings/p- s=parse %s%-1
strings/p- s1=parse %s%-1-,
strings/p- s2=parse %s%-2-,
strings/p- s3=parse %s%-3-,
strings v=sub %s1%%s2%%s3%,1024>unl
if "%v%"=="" goto lss
echo DiskFree ">" 1GB
goto end
:lss
echo DiskFree "<" 1GB
:end
del tmp
echo.
Last edited by lizaoyou on 2007-2-9 at 09:55 AM ]
Implementing under DOS is relatively complicated. The following is an example of using batch to extend strings.com:
@echo off
echo.
set v=
dir d:\|find "free">tmp
strings s=read tmp,1
strings/p- s=mid %s%-9
strings/p- s=parse %s%-1
strings/p- s1=parse %s%-1-,
strings/p- s2=parse %s%-2-,
strings/p- s3=parse %s%-3-,
strings v=sub %s1%%s2%%s3%,1024>unl
if "%v%"=="" goto lss
echo DiskFree ">" 1GB
goto end
:lss
echo DiskFree "<" 1GB
:end
del tmp
echo.
Last edited by lizaoyou on 2007-2-9 at 09:55 AM ]
|
|
2007-2-9 22:53 |
|
|
nicesoft
初级用户
 
积分 98
发帖 47
注册 2007-1-28
状态 离线
|
|
2007-5-1 19:35 |
|