I know this is an old thread, but it shows up in search results a lot so I'm going to put this here in case anyone needs it.
These are the updated commands for deleting files and scheduling a task to remove W3SVC log files from Server 2012.
The Forfiles.exe command for deleting the files is the same as Robert3637 posted above. Here it is for completeness:
Forfiles.exe -p C:\inetpub\logs\LogFiles\W3SVC1 -m *.log -d -30 -c "Cmd.exe /C del @path"
Forfiles.exe -p C:\inetpub\logs\LogFiles\W3SVC1 -m *.log -d -30 -c "Cmd.exe /C del @path" Forfiles.exe -p C:\inetpub\logs\LogFiles\W3SVC2 -m *.log -d -30 -c "Cmd.exe /C del @path"
SCHTASKS /Create /SC Weekly /D SUN /ST 06:00 /TN "W3SVC Logs Maintenance" /TR "C:\inetpub\logs\LogFiles\W3SVC_LogsMaintenance.bat"
taskschd.msc