Windows 10 Batch File to delete folders and its files later than 10 days

  • Thread starter Thread starter SoggyCashew
  • Start date Start date
S

SoggyCashew

Hello, I have folders and thier files that get backed up every so often and get put into a folder named bk_Operator Rate Program. In the bk_Operator Rate Program folder there are folders with thier files within this main folder and they are named by the date they were backed up. Example: bk_ORP_ 02-19-2019. I try to run the bat file below but I get an error.


ERROR: Invalid argument/optin - '@isdir'.

Type "FORFILES /?" for usage.


Here is my .bat file


@echo off


FORFILES -P "H:\BACKUPS\bk_Operator Rate Program\" -d -10 -c "cmd /c IF @isdir == TRUE rd /S /Q @path"


pause >nul

Continue reading...
 
Back
Top