-2

I am tring to write a .bat file to delete files older then 30 days in a specific folder I have tried several diifrent format with no luck.

the closest one i got is

del C:\temp\temp d -30

edit..... ok so i got forfilles /p c:\temp\temp /d how can I make it use the date when its ran instead of always having to go in and change it evrytime I run it and get them to delete them now can any one help me out thanks

william
  • 11
  • 1
  • 4
  • Check this one out for some help: http://stackoverflow.com/questions/18010507/forfiles-command-to-delete-12-hours-old-files-in-bat-file – meatspace Sep 07 '16 at 01:49

1 Answers1

1

There is no such switch available to the DELete command. Type FORFILES /? into a console window, read the output taking special note of the /D parameter.

Compo
  • 36,585
  • 5
  • 27
  • 39