![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-10 15:59 |
47,811 topics / 349,897 posts / today 0 new / 48,255 members |
| DOS批处理 & 脚本技术(批处理室) » Detect the size of drive D, not the available space |
| Printable Version 2,359 / 11 |
| Floor1 a9319751 | Posted 2006-12-09 05:43 |
| 中级用户 Posts 170 Credits 439 | |
|
@echo off
for /f "eol=可 usebackq tokens=3 delims= " %%i in (`fsutil volume diskfree d:`) do echo D drive total space (bytes)=%%i pause |
|
| Floor2 9527 | Posted 2006-12-09 05:47 |
| 银牌会员 Posts 438 Credits 1,185 From 北京 | |
|
This is a bit too much of a tempest in a teapot, right? Just do defrag d: -a...
|
|
| Floor3 a9319751 | Posted 2006-12-09 05:55 |
| 中级用户 Posts 170 Credits 439 | |
Originally posted by 9527 at 2006-12-9 05:47: 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 |
|
| Floor4 9527 | Posted 2006-12-09 05:57 |
| 银牌会员 Posts 438 Credits 1,185 From 北京 | |
|
Actually, I just want to suggest that the filtering conditions of the FOR statement should preferably not have "Chinese".
|
|
| Floor5 a9319751 | Posted 2006-12-09 05:58 |
| 中级用户 Posts 170 Credits 439 | |
Originally posted by 9527 at 2006-12-9 05:57: Thank you for the advice, heh heh, I'm glad to have your help |
|
| Floor6 ccwan | Posted 2006-12-09 06:34 |
| 金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊 | |
|
This method is quite good.
|
|
| Floor7 lxmxn | Posted 2006-12-09 07:21 |
| 版主 Posts 4,938 Credits 11,386 | |
|
Does the building owner's method not work under FAT32? |
|
| Floor8 lxmxn | Posted 2006-12-09 09:30 |
| 版主 Posts 4,938 Credits 11,386 | |
|
```
wmic logicaldisk where "name='d:'" get name,freespace,size ``` |
|
| Floor9 redtek | Posted 2006-12-09 09:33 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
Really powerful command. The execution information is as follows:)
|
|
| Floor10 wudixin96 | Posted 2007-04-06 22:41 |
| 银牌会员 Posts 931 Credits 1,928 | |
|
Good command. Learned.
|
|
| Floor11 htysm | Posted 2007-04-16 05:15 |
| 高级用户 Posts 415 Credits 866 | |
|
Brother lxmxn is very familiar with using "WMIC"!
|
|
| Floor12 lxmxn | Posted 2007-04-16 10:36 |
| 版主 Posts 4,938 Credits 11,386 | |
Originally posted by htysm at 2007-4-15 16:15: Brother, you're overpraising. I currently only know the most basic ones. |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |