0

Using CMD I need to deleted thousands of files that do not have an extension and are within certain time frame 5 years >files to be deleted>30 days. I can try to use PowerShell. I have tried:

forfiles /m *. /d -30 /C "cmd /c rename @file @fname.xyz"  
del /S *.xyz

but because there are other files with .txt extension that are older than 30 days (which I need to keep) it does not work the way I need it to work

Zev Spitz
  • 13,950
  • 6
  • 64
  • 136
  • Move the text files you want to keep somewhere else first. Then run your delete. Then move the text files back again ... – DavidPostill Aug 14 '15 at 08:46
  • You may also want to read [Batch file to delete files older than N days](http://stackoverflow.com/q/51054) – DavidPostill Aug 14 '15 at 08:46
  • Unfortunately I cannot move the files out, that is the reason why newer than 30 days and older than 5 year have to stay – Jose Patino Aug 15 '15 at 00:11

0 Answers0