Windows XP的Forfiles命令

时间:2015-02-04 09:10:37

标签: batch-file

关注问题: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"

它不起作用。

1 个答案:

答案 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"