简体   繁体   中英

How to delete files older than x days with FORFILES?

OS: Windows Server 2008 R2

I've got a small batch file which should delete all backups older than x days in a specific folder.

Command:

forfiles /P "C:\LehrerOffice_Backup\BatchBackup\" /S /M *.* /D -31 /C "cmd /c del @PATH" 

Error:

Invalid argument/option - '@PATH'. Type "forfile /h" for usage

Does anybody know what is wrong?

删除/ P参数中的结尾反斜杠

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM