Get the size of a directory with subdirectories inside

I am looking for a way to be able to get the total size of a folder with subfolders full of files. I have been researching in the forum and there are not many topics, only referring to doing this process but only when the folder contains documents and not subfolders. Does anyone have a structure that I can use for this scenario?

This is what I was using but it gives me a result of 0 since my directory does not have files but subfolders with the files

Convert.ToDouble(Dir_info.EnumerateFiles().Sum(function(f) f.Length)) /(1024*1024))


I have a YouTube Channel and I will create a video and explain, how to do that.
Please see my channel and wait for the new video about your topic :wink:

Here is the link to my channel:
UiPath - Mahmoud TV

Best regards


I Found the solution for anyone looking :shushing_face:

Thanks, I was able to find the solution, but I will still be checking your channel for some extra help, Good luck! :smiley:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.