![]() |
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-07 23:30 |
48,041 topics / 350,128 posts / today 3 new / 48,252 members |
| DOS批处理 & 脚本技术(批处理室) » How to execute commands based on the size of a file? |
| Printable Version 2,571 / 13 |
| Floor1 weapfe | Posted 2006-12-03 01:51 |
| 初级用户 Posts 66 Credits 144 | |
|
Ask the expert:
How can I execute batch processing commands according to the size of a certain (some files)? Description: The files only refer to txt format. |
|
| Floor2 vkill | Posted 2006-12-03 02:05 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
| Floor3 weapfe | Posted 2006-12-03 02:11 |
| 初级用户 Posts 66 Credits 144 | |
Originally posted by vkill at 2006-12-2 13:05: :(;)Don't understand?? I don't know if I can be more detailed, I've only been learning p for a few days? |
|
| Floor4 namejm | Posted 2006-12-03 02:16 |
| 荣誉版主 Posts 1,737 Credits 5,226 From 成都 | |
|
Just run the following code to know how to do it:
|
|
| Floor5 weapfe | Posted 2006-12-03 02:26 |
| 初级用户 Posts 66 Credits 144 | |
|
Thanks everyone~~
Without realizing it, there's another question~~ I wonder if the moderator will let me change the title?~~ Ask: How did you know about that %%~zi?? I learned P in the CMD by using xxxx/? |
|
| Floor6 weapfe | Posted 2006-12-03 02:48 |
| 初级用户 Posts 66 Credits 144 | |
|
If I want to know the files larger than 104K under the C drive~~Everyone, take a look at where my command is wrong??
I ran it on my machine and it said the system couldn't find the file "*.*" @echo off for /f %%i in (c:\*.*) do if "%%~zi" GTR "140" echo %%i pause |
|
| Floor7 tao0610 | Posted 2006-12-03 03:04 |
| 高级用户 Posts 218 Credits 579 | |
|
```
for %%i in (c:\*.*) do if "%%~zi" GTR "140" echo %%i ``` |
|
| Floor8 weapfe | Posted 2006-12-03 03:25 |
| 初级用户 Posts 66 Credits 144 | |
|
Okay, thank you first~~~
I don't know why after adding "/F" it... Also, this seems to be only for files under C: and didn't enter the folder under C: I don't know if it can be modified to execute in the entire disk~~ |
|
| Floor9 tao0610 | Posted 2006-12-03 03:31 |
| 高级用户 Posts 218 Credits 579 | |
| Floor10 weapfe | Posted 2006-12-03 03:56 |
| 初级用户 Posts 66 Credits 144 | |
|
OK, got it. Thanks. Let me see if I can name them for them....
|
|
| Floor11 minmin888 | Posted 2007-05-07 19:05 |
| 初级用户 Posts 62 Credits 127 | |
|
─────────────────── 版务记录 ──────────────────── Executor: bjsh Description: Spamming Punishment: Since it is a new member of the forum, no punishment is temporarily given; if found again, it will be severely punished ─────────────────── 版务记录 ──────────────────── Learned something! [ Last edited by bjsh on 2007-5-7 at 08:21 PM ] |
|
| Floor12 zhhuang | Posted 2008-03-29 09:37 |
| 新手上路 Posts 4 Credits 8 | |
|
Thanks, just needed this batch script
|
|
| Floor13 munai | Posted 2008-03-29 11:25 |
| 新手上路 Posts 1 Credits 2 | |
|
A bit profound, can't understand it to say
|
|
| Floor14 tvzml | Posted 2008-03-30 03:52 |
| 初级用户 Posts 67 Credits 157 | |
|
@echo off
for /r c:\ %%i in (*.exe) do if "%%~zi" GTR "106496" echo %%i pause |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |