Delete Files on Schedule

ghartz70
ghartz70 Member, Managed Service Provider CHOCOLATE MILK

We have a program that creates multiple log files per day.

They 're named something like, “LogFile_DATETIME"

Is there a way to configure an automation that would purge files that may not all have the same name? If they all begin with the same “LogFile_”

Tagged:
1
1 votes

Active · Last Updated

Comments

  • tom@tbkconsulting.biz
    [email protected] Member, Managed Service Provider RED EYE

    Use powershell or batch file with del LogFile*.* of course you can pipe another command on top of that to select only specific dates, etc.

  • ghartz70
    ghartz70 Member, Managed Service Provider CHOCOLATE MILK

    Thanks Tom,

    For this example, would I need to include the'_'?
    del LogFile_*.*

  • tom@tbkconsulting.biz
    [email protected] Member, Managed Service Provider RED EYE

    Only if you have other files that have LogFile as part of the name that do not have the _ and you do not want to delete those!