0
我有一個目錄,裏面有大約1000個文件。 我想獲取自7天以來最後更新的文件名?並將此文件名寫入另一個文件。 我正在使用Windows 2012,我想用批處理腳本來做到這一點。我該怎麼做?如何查找自1周以來的最新更新文件?
更新: 我試過
@echo off
setlocal enableextensions disabledelayedexpansion
set "folder=c:\some\where"
( for /f "tokens=*" %%a in ('
robocopy "%folder%" "%folder%" * /l /nocopy /is /maxage:7 /njh /njs /nc /ns /ndl
') do echo(%%a
) > outputFile.txt
不過,我收到此錯誤:
ERROR : No Destination Directory Specified.
Simple Usage :: ROBOCOPY source destination /MIR
source :: Source Directory (drive:\path or \\server\share\path).
destination :: Destination Dir (drive:\path or \\server\share\path).
/MIR :: Mirror a complete directory tree.
For more usage information run ROBOCOPY /?
****/MIR可以刪除文件,以及將它們複製!