
CODE: [Copy to clipboard]@echo off
set/p d_=请输入要查找的路径(默认当前文件夹):
set/p date_=请输入查询的文件的创建日期:
if not defined date_ goto error
set/p time1=输入起始时间:
if not defined time1 goto error
set/p time2=请输入结束时间:
if not defined time2 goto error
cls
echo 查找结果:&&echo;
for /f "skip=5 tokens=1,2,4*" %%a in ('dir /a-d/od/tc "%d_%" ^| find "%date_%"') do (
if %%b geq %time1% if not %%b geq %time2% (
echo %%c
)
)
pause
goto :eof
:error
echo 输入错误
pause
CODE: [Copy to clipboard]@echo off
set/p d_=请要查找的路径输入路径(默认当前文件夹):
:error
set/p date_=请输入查询的文件的创建日期:
if not defined date_ goto error
set/p time1=输入起始时间:
if not defined time1 goto error
set/p time2=请输入结束时间:
if not defined time2 goto error
cls
echo 查找结果:&&echo;
for /f "tokens=1,2,4*" %%a in ('dir /a-d/od/tc "%d_%" ^| find "%date_%"') do if %%b geq %time1% if not %%b geq %time2% echo %%c
pause
CODE: [Copy to clipboard]上面是查找2006年11月26号20点到23点间D盘下创建的文件的例子,你可以自己指定盘符,目录等等其他过滤条件。wmic datafile where "InstallDate>'20061126200000.000000+480' and drive='d:' and InstallDate<'20061126230000.000000+480'" get caption
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |