For specific files FORFILES /P "C:\MyPath\" /S /M log*.xml /D -30 /C "cmd /c del @file"

For files and subfolders: FORFILES /P "C:\MyPath\" /S /D -30 /C "cmd /c IF @isdir == TRUE rd /S /Q @path"