I have come across an issue that was previously (embarrassingly) unthought of by me, and am not having much luck searching for a suitable solution.
I can use
to get an array of directories for a given path. I foolishly thought this would return a list of dirs whether i had access or not (as i'm not actually accessing them yet, just seeing what's there!) But if i set my path to, say, F drive (which is the root of my external hard drive) the command fails on dirs that i don't have access to such as Recycler and System Volume Info.
What is the train of thought to do this correctly, i.e. return an array of all dirs in the path while skipping errors?
I can use
VB.NET:
ArrDirs = Directory.GetDirectories(Pth, "*", 1)
to get an array of directories for a given path. I foolishly thought this would return a list of dirs whether i had access or not (as i'm not actually accessing them yet, just seeing what's there!) But if i set my path to, say, F drive (which is the root of my external hard drive) the command fails on dirs that i don't have access to such as Recycler and System Volume Info.
What is the train of thought to do this correctly, i.e. return an array of all dirs in the path while skipping errors?