Automate Profile Upgrades

Greetings!

Situation:
We are using a custom developed inhouse addin that requires profile updates on the TWC server every 4 weeks. The only way to do this currently is to manually upgrade all projects in batches (because if MagicDraw hits the 8gb RAM limit, it gets veeerry slow) of a few projects, restart the client and do the next batch. This is very time consuming (it's up to 4 hours now if using one machine). I assume that we are not the only ones with a lot of projects that require the occasional profile update.

Question:
Is it possible to upgrade a project (we always use the "upgrade to XY" functionality in the client) via script from outside of the client?

I have looked into the examples of how to run functions via batch file but couldn't find the function that could do this.

Request:
I would love to have a one-in-all-solution script that loops through all projects and upgrades those.

Thanks a lot!