superhsj 当前离线
列兵
TOP
hfxiang 当前离线
上尉
for /f "usebackq" %a in (`forfiles /p . /m *.* /c "cmd /c echo @file,@ftime"`) do @for /f "tokens=1-2* delims=:," %b in ("%a") do @if %c lss 10 @echo;%b %c:%d复制代码
aloha20200628 当前离线
@echo off for /f "delims=" %%D in ('date/t') do set "today=%%D" for /f "tokens=1-5 delims=: " %%1 in ('dir/a-d/od/tc^|findstr %today%') do ( if "%%2" geq "00" if "%%2" lss "07" (echo,hh:mm=%%2:%%3 %%5) ) pause&exit/b复制代码
再次求助大佬,现在取出时间确实没有问题了,目前的问题的取出来的时间格式“9:59:42”跟我自定义时间比较的 ... superhsj 发表于 2022-8-22 10:47
D:\temp>for /f "usebackq tokens=*" %a in (`forfiles /p "d:\temp" /m *.* /c "cmd /c if @isdir==FALSE if not @ftime leq 10 echo @ftime"`) do @echo %a 10:26:17 9:59:42复制代码
for /f "usebackq tokens=*" %a in (`forfiles /p . /m test.txt /c "cmd /c echo @fdate,@ftime"`) do @echo %a复制代码