Select files between two dates

柔情痞子 提交于 2020-01-05 08:12:14

问题


@echo off
forfiles /p "C:\Documents and Settings\Test\Downloads" /d +01/07/2011 /d -15/07/2011 /c "cmd /c echo @file"
pause

Hello,

I would like to select all files modified between 01/07/11 and 15/07/11 (French : jj/mm/aaaa or USA : dd/mm/yyyy). But the "/d" parameter can be used only one time. How can I do that ?

Thanks if you can help me. :)


回答1:


This is not an option for that particular command. You could use the selection as input to a FOR loop. Add another indention for each criteria you need.

FOR /F "delims=*" %%A IN ('forfiles /d -05/07/2011') DO (
    FOR /F "delims=*" %%B IN ('forfiles /m %%A /d +05/01/2011') DO (
        ECHO %%B
    )
)


来源:https://stackoverflow.com/questions/7758987/select-files-between-two-dates

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!