Link to home
Start Free TrialLog in
Avatar of abcserve
abcserveFlag for United States of America

asked on

Retrieve all files from Windows based folder structure with random folder depth-- VB.NET 2012

I need to retrieve files from a directory/folder structure that has files and folders at extreme ends of folder depth.  All folders will start with (as an example)...H:\Staging\Acquistion_Staging\.....Folder depth after this initial start are anywhere between 1 and 8 folder levels deep.  A mix of files and folders may be at the same folder level.  I can retrieve/process files when I know the folder depth and when files are at the same level as as the known folder level.  The situation I am in has over 7500 files in over 950 folders where the folder depth is inconsistent (ranging from 4 to 11 levels deep).  What I am trying to determine is how I can automatically retrieve a file when I do not have a known folder depth. Is there a way determine the depth of any given folder?  Any direction on this is appreciated.
SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of abcserve

ASKER

Thank you both (Eric and Saige).  I was able to get the list easily written to a text file.  The FULLPATH name is creating a problem, but I can get worked thru that...Saige, your example was used, however the extra comments in Eric's was helpful.  Thanks.
Thanks for the quick feedback on my question.  Would like to give you both 500 points.