This is more for general feedback. But was playing around with iterating folder->subfolder with size in MB. I know WB can set Erromode On or off, but also want to capture any folders where 'access is denied'... I asked Claude who responded with a Powershell script.. try=>catch using System.UnauthorizedAccessException as the catch error.
Unfortunately, although the basic script would work, could not capture the folders that were not accessible to the file I was writing output to. Googled it and seems others had consternation. One remedy was to use the more general Win Exception.Message which is a property of that class...
Even running as Admin, some folders on local PC/laptop may still show as access denied, but cannot be iterated by script. Yes, you can turn error handing off, or with PS - $erroractionPreference="SilentlyContinue" - but will still noy capture folders with access denied.
I found there is a generic Exception class with a .message property. But I ccanot figure out how to handle that.
Back to the question: I might have tested with PS, but need this as a WB solution. Is going into .NET classes via CLR worth the effort, or can standard WB errorhandling perform
- Generate an Array of all folder starting from... C:\
- ForEach folder iterate sib-folders and calculate spaced used in MB
- If folder/subfolder cannot be accessed, indicate folder name + "access denoed"