Find files on Windows modified after a given date using the command line

前端 未结 7 1250
南旧
南旧 2021-02-04 07:40

I need to search a file on my disk modified after a given date using the command line.

For example:

   dir /S /B WHERE modified date > 12/07/2013
         


        
7条回答
  •  北海茫月
    2021-02-04 08:27

    I had the same problem, so I created a list using XCOPY and the modified-by date I was looking for, used a for loop to traverse the list, and added the date/time information I needed for each file to a log:

    xcopy X:\file_*.log X:\temp /D:07-17-2014 /L /Y > X:\files.txt
    for /f "tokens=* delims=" %%a in (X:\files.txt ) do (
        @echo %%~ta %%a >> X:\files.log
    )
    

    It resulted in something like the following, which is exactly what I wanted.

    X:\>()
    07/17/2014 09:41 AM X:\file_201407170600.log
    
    X:\>()
    07/17/2014 09:41 AM X:\file_201407170615.log
    
    X:\>()
    07/17/2014 09:23 AM X:\file_201407170630.log
    

提交回复
热议问题