Avatar of abcserve
abcserve
Flag 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.
Visual Basic.NET

Avatar of undefined
Last Comment
abcserve

8/22/2022 - Mon
SOLUTION
Éric Moreau

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
it_saige

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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.
abcserve

ASKER
Thanks for the quick feedback on my question.  Would like to give you both 500 points.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes