关注问题:https://stackoverflow.com/search?q=Batch+file+to+delete+files+older+than+N+days -
我改变它以便在另一台具有Windows XP的机器上工作:
forfiles -p"%%~a" -s -m*.* -d%days% -c"cmd /c if /i @isdir==true echo Deleting... @path & echo @path>>C:\Jobfolder\Folders_that_deleted.txt & rd /s /q @path"
它不起作用。
答案 0 :(得分:1)
(在评论和问题编辑中回答。转换为社区维基答案。请参阅What is the appropriate action when the answer to a question is added to the question itself?)
OP写道:我从link下载了
Forfiles.exe
并将其复制到C:\ windows \ system32。我的forfiles
是(它在Windows 7中完美运行):forfiles /p "%%~a" /d %days% /c "cmd /c if /i @isdir==true echo Deleting... @path & echo @path>>C:\Jobfolder\Folders_that_deleted.txt & rd /s /q @path"