Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Windows (https://www.askmehelpdesk.com/forumdisplay.php?f=237)
-   -   How to delete Folders and Files that are older than x number of days using batch (https://www.askmehelpdesk.com/showthread.php?t=797306)

  • Jul 22, 2014, 03:51 AM
    fregoton
    How to delete Folders and Files that are older than x number of days using batch
    Hi,

    I was searching an answer for this question but I was only able to find this batch code that deletes files but not folders is there any way I can also delete folders in a specific date in a windows directory.
    [MENTION=21871]Echo[/MENTION] OFF
    ECHO
    forfiles /p C:\Temp /s /m *.* /d -30 /c "cmd /c del echo [MENTION=36112]FIL[/MENTION]E"
    EXIT
  • Jul 22, 2014, 05:49 AM
    NeedKarma
    Unless you really want to stick with a command line solution to me the best solution is to use Windows Explorer and set the View to Details, then sort the Date Modified column (or any other date column you wish to use).

  • All times are GMT -7. The time now is 05:50 PM.