Here is a sample monthly scheduled task to automatically delete
logfiles older than 30 days. The Windows server command which will be used for this is:
forfiles /P c:\windows\system32\logfiles /S /M *.log /D -30 /C “cmd /c del /F @path”
Modify the path and number of days as needed.