It depends on where you run your code and where the repository and db files are located.
I run my code on the ALM server where the repository is also located. The DB files are located on another server.
I use the Scripting.FileSystemObject object and the method GetFolder to get the parent Repository folder for each project. Then I take the Size property to get the size (in bytes) of the folder.
To get the DB file size, since those are on a different server, I use the WbemScripting.SWbemLocator object. If you run the code to get the DB size on the same server where the DB files are located then you could use the FileSystemObject instead.
I run my code on the ALM server where the repository is also located. The DB files are located on another server.
I use the Scripting.FileSystemObject object and the method GetFolder to get the parent Repository folder for each project. Then I take the Size property to get the size (in bytes) of the folder.
To get the DB file size, since those are on a different server, I use the WbemScripting.SWbemLocator object. If you run the code to get the DB size on the same server where the DB files are located then you could use the FileSystemObject instead.