We have a large .SLN files with many project files. I started the policy of having a "ViewLocal" directory where all non-sourcecontrolled files are located. Inside that directory is an 'Inter' and an 'Out' directory. For the intermediate files, and the output files, respectively.
This obviously makes it easy to just go to your 'viewlocal' directory and do a simple delete, to get rid of everything.
Before you spent time figuring out a way to work around this with scripts, you might think about setting up something similar.
I won't lie though, maintaining such a setup in a large organization has proved....interesting. Especially when you use technologies such as QT that like to process files and create non-sourcecontrolled source files. But that is a whole OTHER story!