China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-25 06:50
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Detect the size of drive D, not the available space View 2,298 Replies 11
Original Poster Posted 2006-12-09 05:43 ·  中国 河南 郑州 电信
中级用户
★★
Credits 439
Posts 170
Joined 2006-01-09 20:29
20-year member
UID 48707
Status Offline
@echo off
for /f "eol=可 usebackq tokens=3 delims= " %%i in (`fsutil volume diskfree d:`) do echo D drive total space (bytes)=%%i
pause
bat c c++
Floor 2 Posted 2006-12-09 05:47 ·  中国 北京 联通
银牌会员
★★★
努力做坏人
Credits 1,185
Posts 438
Joined 2006-08-28 12:00
19-year member
UID 61449
From 北京
Status Offline
This is a bit too much of a tempest in a teapot, right? Just do defrag d: -a...
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +3 2006-12-09 06:58
我今后在论坛的目标就是做个超级坏人!!!
Floor 3 Posted 2006-12-09 05:55 ·  中国 河南 郑州 电信
中级用户
★★
Credits 439
Posts 170
Joined 2006-01-09 20:29
20-year member
UID 48707
Status Offline
Originally posted by 9527 at 2006-12-9 05:47:
This is a bit overkill, isn't it?

defrag d: -a is enough.......


D:\>defrag d: -a
Windows Disk Defragmenter
Copyright (c) 2001 Microsoft Corp. and Executive Software International Inc.

Analysis Report
Total 31.25 GB, 15.57 GB (49%) free, 31% fragmented (62% file fragments)

You should defragment this volume.

This command is also good, just a bit slow
bat c c++
Floor 4 Posted 2006-12-09 05:57 ·  中国 北京 联通
银牌会员
★★★
努力做坏人
Credits 1,185
Posts 438
Joined 2006-08-28 12:00
19-year member
UID 61449
From 北京
Status Offline
Actually, I just want to suggest that the filtering conditions of the FOR statement should preferably not have "Chinese".
我今后在论坛的目标就是做个超级坏人!!!
Floor 5 Posted 2006-12-09 05:58 ·  中国 河南 郑州 电信
中级用户
★★
Credits 439
Posts 170
Joined 2006-01-09 20:29
20-year member
UID 48707
Status Offline
Originally posted by 9527 at 2006-12-9 05:57:
Actually, I just want to suggest that you'd better not have "Chinese" in the filtering conditions of the FOR statement.



Thank you for the advice, heh heh, I'm glad to have your help
bat c c++
Floor 6 Posted 2006-12-09 06:34 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
This method is quite good.
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 7 Posted 2006-12-09 07:21 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline

  Does the building owner's method not work under FAT32?
Floor 8 Posted 2006-12-09 09:30 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
```
wmic logicaldisk where "name='d:'" get name,freespace,size
```
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
redtek +5 2006-12-09 09:34
htysm +2 2007-04-16 05:15
Floor 9 Posted 2006-12-09 09:33 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Really powerful command. The execution information is as follows:)


C:\WINDOWS>wmic logicaldisk where "name='d:'" get name,freespace,size

FreeSpace Name Size
1073655808 D: 20966236160
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 10 Posted 2007-04-06 22:41 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 1,928
Posts 931
Joined 2007-01-06 11:46
19-year member
UID 75624
Gender Male
Status Offline
Good command. Learned.
Floor 11 Posted 2007-04-16 05:15 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 866
Posts 415
Joined 2005-12-04 11:19
20-year member
UID 46459
Status Offline
Brother lxmxn is very familiar with using "WMIC"!
Floor 12 Posted 2007-04-16 10:36 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Originally posted by htysm at 2007-4-15 16:15:
Brother lxmxn is very familiar with using "WMIC"!

Brother, you're overpraising. I currently only know the most basic ones.
Forum Jump: