|
sanxiao88
初级用户
 
积分 37
发帖 14
注册 2008-2-17
状态 离线
|
『楼 主』:
如何在纯dos下用批处理显示分区的已用空间和剩余空间?
使用 LLM 解释/回答一下
如何在纯dos下,即在纯dos7.1或dos6.22下,而不是在XP的dos窗口,用批处理显示分区剩余空间和已用空间?包括FAT32分区和NTFS分区。哪位大虾、高人可以做到?
我知道在XP的dos下,可以这样:
@echo off
cls
setlocal EnableDelayedExpansion
echo.
echo.
echo ╔══════════════════════════════╗
echo ║ 磁盘分区 磁盘卷标名 剩余空间(MB) ║
echo ║ _____________________________________________________ ║
for %%d in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
if exist %%d:\nul (
for /f "tokens=3" %%z in ('dir /-c %%d:\') do set freesize=%%z
set /a freesize=!freesize:~0,-3!/1049>nul
set freesize= !freesize!
set freesize=!freesize:~-9!
for /f "tokens=3*" %%v in ('vol %%d:') do set volume=%%w
set volume= !volume!
set volume=!volume:~-20!
echo ║ %%d: !volume! !freesize! ║
)
)
echo ╚══════════════════════════════╝
pause>nul
Last edited by sanxiao88 on 2008-11-5 at 20:55 ]
How to display the remaining space and used space of partitions in pure DOS, that is, under pure DOS 7.1 or DOS 6.22, not in the DOS window of XP, using batch processing? Including FAT32 partitions and NTFS partitions. Which expert or master can do it?
I know that in the DOS of XP, it can be like this:
@echo off
cls
setlocal EnableDelayedExpansion
echo.
echo.
echo ╔══════════════════════════════╗
echo ║ Disk Partitions Disk Volume Name Remaining Space (MB) ║
echo ║ _____________________________________________________ ║
for %%d in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
if exist %%d:\nul (
for /f "tokens=3" %%z in ('dir /-c %%d:\') do set freesize=%%z
set /a freesize=!freesize:~0,-3!/1049>nul
set freesize= !freesize!
set freesize=!freesize:~-9!
for /f "tokens=3*" %%v in ('vol %%d:') do set volume=%%w
set volume= !volume!
set volume=!volume:~-20!
echo ║ %%d: !volume! !freesize! ║
)
)
echo ╚══════════════════════════════╝
pause>nul
Last edited by sanxiao88 on 2008-11-5 at 20:55 ]
|
|
2008-11-5 20:44 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
dos下的没那么简单,只能去找一些有此功能的一键工具,看里面的脚本。
99%没人专门为你写脚本的。
It's not that simple under DOS. You can only look for some one-click tools that have this function and check the scripts inside. 99% of the time, no one will specifically write a script for you.
|

Windows 一键还原
http://www.yjhy.com |
|
2008-11-5 21:22 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2008-11-5 22:25 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
|
2008-11-6 04:21 |
|
|
sanxiao88
初级用户
 
积分 37
发帖 14
注册 2008-2-17
状态 离线
|
『第 5 楼』:
4楼版主的链接我看了,不行啊!谁有GET.EXE?
使用 LLM 解释/回答一下
4楼版主的链接我看了,不行啊!不过,也要谢谢你们了!
另外,谁有GET.EXE小程序,让我试试这样:
get k c:
strings free=div %get%,1024
Last edited by sanxiao88 on 2008-11-6 at 20:53 ]
I checked the link on the 4th floor, but it doesn't work! However, I still want to thank you all!
Additionally, does anyone have the GET.EXE small program? Let me try this:
get k c:
strings free=div %get%,1024
Last edited by sanxiao88 on 2008-11-6 at 20:53 ]
|
|
2008-11-6 20:52 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
"不行啊"是咋个表现形式呢?
How does "no good" manifest itself?
|

 |
|
2008-11-7 09:52 |
|
|
jh1688
中级用户
  
积分 248
发帖 126
注册 2008-5-30
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
@echo off
:mini_BEGIN
if exist mini_dd.txt del mini_dd.txt
minito /nohp /p /ifs>mini_dd.txt
strings lines=LINESIZE mini_dd.txt
if %lines%#==0# goto fail
strings lines=add %lines%,1
set line=1
echo 硬盘信息:
:mini
strings line=add %line%,1
if %line%#==%lines%# goto mini_1
strings lined=read mini_dd.txt,%line%
strings row1=left %lined%,3
strings row3=mid %lined%,8,2
strings row5=mid %lined%,19,3
strings row7=right %lined%,7
if %row5%#==YES# set actp=%row1%
set lastp=%row1%
set lastd=%row3%
set lastk=%row7%
if not %lined%#==# echo %lined%
goto mini
:mini_1
echo.
echo 请根据上面显示的硬盘信息确认识别结果。
echo.
echo 自动识别结果:
echo 活动分区是:%actp%
echo 最后分区是:%lastp%
echo 最后分区对应的盘符是:%lastd%
echo 最后分区可用空间是:%lastk%Mb
echo.
if exist mini_dd.txt del mini_dd.txt
goto exit
:fail
cls
echo.
echo 很抱歉,本工具采用的软件未能获得有效硬盘信息。
echo.
if exist mini_dd.txt del mini_dd.txt
:exit
理面用到的DOS第三方工具在本坛可以找到,麻烦楼主自己搜一下啦……
@echo off
:mini_BEGIN
if exist mini_dd.txt del mini_dd.txt
minito /nohp /p /ifs>mini_dd.txt
strings lines=LINESIZE mini_dd.txt
if %lines%#==0# goto fail
strings lines=add %lines%,1
set line=1
echo Hard disk information:
:mini
strings line=add %line%,1
if %line%#==%lines%# goto mini_1
strings lined=read mini_dd.txt,%line%
strings row1=left %lined%,3
strings row3=mid %lined%,8,2
strings row5=mid %lined%,19,3
strings row7=right %lined%,7
if %row5%#==YES# set actp=%row1%
set lastp=%row1%
set lastd=%row3%
set lastk=%row7%
if not %lined%#==# echo %lined%
goto mini
:mini_1
echo.
echo Please confirm the recognition result according to the hard disk information displayed above.
echo.
echo Automatic recognition result:
echo Active partition is: %actp%
echo Last partition is: %lastp%
echo The drive letter corresponding to the last partition is: %lastd%
echo The available space of the last partition is: %lastk%Mb
echo.
if exist mini_dd.txt del mini_dd.txt
goto exit
:fail
cls
echo.
echo Sorry, the software used by this tool failed to obtain valid hard disk information.
echo.
if exist mini_dd.txt del mini_dd.txt
:exit
The third-party DOS tools used here can be found in this forum. Please ask the thread starter to search for them by themselves...
|
|
2008-11-7 18:01 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
Originally posted by jh1688 at 2008-11-7 18:01:
@echo off
:mini_BEGIN
if exist mini_dd.txt del mini_dd.txt
minito /nohp /p /ifs>mini_dd.txt
strings lines=LINESIZE mini_dd.txt
if %lines%#==0# goto fail
strings lines=add %lines%,1
set li ...
此法不能处理ntfs分区的剩余空间。
Originally posted by jh1688 at 2008-11-7 18:01:
@echo off
:mini_BEGIN
if exist mini_dd.txt del mini_dd.txt
minito /nohp /p /ifs>mini_dd.txt
strings lines=LINESIZE mini_dd.txt
if %lines%#==0# goto fail
strings lines=add %lines%,1
set li ...
This method cannot handle the free space of NTFS partitions.
|

Windows 一键还原
http://www.yjhy.com |
|
2008-11-7 18:17 |
|
|
jx1988020488
新手上路

积分 8
发帖 4
注册 2008-10-4
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
显示剩余空间
for %%a in (c: d: e: f:) do (
for /f "tokens=3" %%b in ('dir %%a^|find "可用字节"') do echo %%b 字节>>123.txt
)
Display remaining space
for %%a in (c: d: e: f:) do (
for /f "tokens=3" %%b in ('dir %%a^|find "Available bytes"') do echo %%b bytes>>123.txt
)
|
|
2008-11-8 20:26 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
Originally posted by jx1988020488 at 2008-11-8 20:26:
显示剩余空间
for %%a in (c: d: e: f:) do (
for /f "tokens=3" %%b in ('dir %%a^|find "可用字节"') do echo %%b 字节>>123.txt
)
纯dos下能运行吗?呵呵。
看清楚楼主要求。
cmd下的楼主已经有了。
Originally posted by jx1988020488 at 2008-11-8 20:26:
Display remaining space
for %%a in (c: d: e: f:) do (
for /f "tokens=3" %%b in ('dir %%a^|find "Available bytes"') do echo %%b bytes>>123.txt
)
Can it run in pure DOS? Hehe.
Please see the owner's requirements clearly.
The owner already has it under cmd.
|

Windows 一键还原
http://www.yjhy.com |
|
2008-11-9 11:49 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
pqdi(PowerQuest Drive Image)有此功能,只是个头大了些。
自己稍微处理一下即可。

pqdi (PowerQuest Drive Image) has this function, just a bit larger in size.
Just deal with it a little by yourself.

|

Windows 一键还原
http://www.yjhy.com |
|
2008-11-9 16:58 |
|
|
sanxiao88
初级用户
 
积分 37
发帖 14
注册 2008-2-17
状态 离线
|
『第 12 楼』:
请大家读懂我的要求再回答,也谢谢各位的热心哦
使用 LLM 解释/回答一下
也许我没有表达清楚,目前为止,还没有很合适的答案,在此,我再详细表述我的要求,希望高人指点,也希望更多的人参与讨论,哪怕抛砖引玉也可以。谢谢!题目要求是:
1.在纯dos下,即用DOS7.1或dos6.22启动盘引导后,A:\>,而不是在XP或win2000的cmd窗口执行;
2.用批处理包括借助其它第3方小工具软件得到各个分区(包括FAT32分区和NTFS分区)的剩余空间和已用空间的数值?包括FAT32分区和NTFS分区。cmd下的我已经有很多了。

Maybe I didn't express it clearly. So far, there isn't a very suitable answer. Here, I will describe my requirements in detail again, hoping that experts can give guidance, and also hoping that more people will participate in the discussion, even if it's just to start a discussion. Thank you! The topic requirements are:
1.Under pure DOS, that is, after booting with a DOS 7.1 or DOS 6.22 boot disk, A:\>, not executing in the cmd window of XP or win2000;
2.Use batch processing including with the help of other third-party small tool software to obtain the values of the remaining space and used space of each partition (including FAT32 partitions and NTFS partitions)? Including FAT32 partitions and NTFS partitions. I already have many under cmd.

|
|
2008-11-15 13:27 |
|
|
youkaib
初级用户
 
积分 61
发帖 22
注册 2008-10-19
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
加个外部命令即可。具体这样写。
@echo off
echo 请在列出驱动器:
fsutil fsinfo drives
echo 是否查询驱动器空间
set /p a=(y/n):
if "%a%"=="n" exit
echo 正在列出驱动器的磁盘空间:
for %%i in (c: d: e: f: g: h: i: j: k:) do (
echo %%i 使用是:
fsutil volume diskfree %%i
echo.
)
echo 操作完成!
echo 欢迎您加入QQ74487678群。许多高手期待着您的加入。
pause >nul
这个更明确一点,比用你的dir方便多了。不过有个缺陷,就是遇到未知设备会报错。这个需要将前面再扩充几条语句。
Just add an external command. Specifically, write it like this.
@echo off
echo Please list the drives:
fsutil fsinfo drives
echo Do you want to query the drive space
set /p a=(y/n):
if "%a%"=="n" exit
echo Listing the disk space of drives:
for %%i in (c: d: e: f: g: h: i: j: k:) do (
echo %%i usage is:
fsutil volume diskfree %%i
echo.
)
echo Operation completed!
echo Welcome to join QQ group 74487678. Many experts are looking forward to your joining.
pause >nul
This is clearer, much more convenient than using your dir. But there is a defect, that is, it will report an error when encountering an unknown device. This needs to expand a few more statements before.
|
|
2008-11-16 13:20 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
Originally posted by youkaib at 2008-11-16 13:20:
加个外部命令即可。具体这样写。
@echo off
echo 请在列出驱动器:
fsutil fsinfo drives
echo 是否查询驱动器空间
set /p a=(y/n):
if "%a%"=="n" ...
看看别人的要求吧,此类脚本手里已有多种了。呵呵。
难道真是不明白什么是dos?
1.在纯dos下,即用DOS7.1或dos6.22启动盘引导后,A:\>,而不是在XP或win2000的cmd窗口执行;
2.用批处理包括借助其它第3方小工具软件得到各个分区(包括FAT32分区和NTFS分区)的剩余空间和已用空间的数值?包括FAT32分区和NTFS分区。cmd下的我已经有很多了。
Originally posted by youkaib at 2008-11-16 13:20:
Just add an external command. Specifically, write like this.
@echo off
echo Please list the drives:
fsutil fsinfo drives
echo Do you want to query the drive space
set /p a=(y/n):
if "%a%"=="n" ...
Take a look at others' requirements. I already have multiple such scripts. Hehe.
Could it really be that you don't understand what DOS is?
1. In pure DOS, that is, after booting with a DOS 7.1 or DOS 6.22 boot disk, it's A:\>, not executing in the cmd window of XP or win2000;
2. Use batch processing including relying on other third-party small tool software to obtain the values of the remaining space and used space of each partition (including FAT32 partitions and NTFS partitions)? Including FAT32 partitions and NTFS partitions. I already have many under cmd.
|

Windows 一键还原
http://www.yjhy.com |
|
2008-11-16 16:11 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
11楼推荐的pqdi,是一个能满足要求的工具,看来你还看不上,呵呵。
The pqdi recommended by the 11th floor is a tool that can meet the requirements. It seems you still don't think highly of it, heh heh.
|

Windows 一键还原
http://www.yjhy.com |
|
2008-11-16 16:13 |
|