问题
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?
回答1:
Remove the ending backslash in the /P argument
来源:https://stackoverflow.com/questions/26295850/how-to-delete-files-older-than-x-days-with-forfiles