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-22 12:03
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Original] Find files that meet the time range with batch processing DigestI View 15,474 Replies 23
Floor 16 Posted 2006-10-21 00:07 ·  中国 浙江 宁波 鹏博士宽带
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
20-year member
UID 40733
Gender Male
Status Offline
I wrote another sequential structure, which seems even more messy.
But it can be used as a tentative discussion for using for to intercept multi-line commands.


  1. @echo off
  2. set Bdate=%1
  3. set Edate=%2
  4. for /f "tokens=1,2 delims" %%a in (
  5. '^(^(for %%i in ^(*^) do @echo %%~ti§%%i§^)
  6. ^&echo.%Bdate% 00:00§
  7. ^&echo.%Edate% 99:99§
  8. ^)^|sort') do (
  9. call :sub "%%a" "%%b"
  10. )
  11. goto :EOF

  12. :sub
  13. if "%~1" == "%Edate% 99:99" set flag=0
  14. if "%flag%" == "1" echo."%~1"§"%~2"
  15. if "%~1" == "%Bdate% 00:00" set flag=1
  16. goto :EOF
Wuxinai posted on 2006-10-20 12:03
  ☆开始\运行 (WIN+R)☆
%ComSpec% /cset,=何奈无── 。何奈可无是原,事奈无做人奈无&for,/l,%i,in,(22,-1,0)do,@call,set/p= %,:~%i,1%<nul&ping/n 1 127.1>nul

Floor 17 Posted 2006-10-21 00:27 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline

  
  This sentence

  for /f "tokens=1,2 delims=§" %%a in ('"%~0" $^|sort') do

  The content inside the brackets is not very clear, especially the usage of ""%~0" $". I hope the moderator can give some guidance.
Floor 18 Posted 2006-10-21 00:31 ·  中国 北京 联通
银牌会员
★★★
努力做坏人
Credits 1,185
Posts 438
Joined 2006-08-28 12:00
19-year member
UID 61449
From 北京
Status Offline
Helplessly, the version master's nested FOR statements not only reduced the amount of code but also increased the difficulty of understanding the code, heh heh.........

[ Last edited by 9527 on 2006-10-21 at 00:34 ]
我今后在论坛的目标就是做个超级坏人!!!
Floor 19 Posted 2007-05-10 14:04 ·  中国 陕西 西安 电信
新手上路
Credits 5
Posts 4
Joined 2007-05-10 13:52
19-year member
UID 88075
Gender Male
Status Offline
Long time no see, learning
Floor 20 Posted 2007-05-14 02:47 ·  中国 广东 阳江 电信
初级用户
Credits 39
Posts 20
Joined 2007-05-14 02:07
19-year member
UID 88451
Gender Male
Status Offline
That's amazing```````````````
Floor 21 Posted 2010-10-11 21:46 ·  中国 江西 南昌 电信
新手上路
Credits 2
Posts 2
Joined 2010-10-10 19:26
15-year member
UID 175651
Gender Female
Status Offline
There's no help. The moderator's bat has reached a level that I can't understand it!
Floor 22 Posted 2010-10-15 06:10 ·  中国 台湾 台湾宽频通讯顾问股份有限公司
初级用户
★★
Credits 68
Posts 64
Joined 2009-05-23 20:43
17-year member
UID 145803
Gender Male
Status Offline
It seems that can not search subdirectory.
Floor 23 Posted 2010-10-20 18:35 ·  中国 广西 防城港 电信
初级用户
Credits 23
Posts 17
Joined 2010-03-30 17:53
16-year member
UID 163429
Gender Male
Status Offline
Marking this.
Floor 24 Posted 2010-11-14 03:01 ·  中国 上海 电信
新手上路
Credits 5
Posts 4
Joined 2007-08-29 22:29
18-year member
UID 96144
Gender Male
Status Offline
Make a mark
Learn slowly later
Hehe
Forum Jump: