Windows file list into excel sheet

I want to get a listing of all files under a directory  along with the full path ( or relative path)
I want the list of all files including the subdirectories  ( This is Windows server 2012)
There are about 3 million files altogether
 I want the whole list ( File names with extension  and paths )  in an excel sheet or MS Access DB

Can you please help?
Sam OZAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JohnBusiness Consultant (Owner)Commented:
From a command prompt:    DIR /s /a  > file.txt  and wait a very long time for that many files
0
Omar SoudaniSystem Support EngineerCommented:
Open command line and use this:

dir /a /s /b > filelist.txt  

you can open the file using excel when done.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin MillerCTOCommented:
Both John and Omar gave a simple method for creation of a fix file format, which you can now open in Excel and import.

Excel will prompt you regarding fields, delimited or fixed, and show you results.  You can import either way that works for your desired output.
1
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Bill PrewCommented:
Here is the best approach, and the meaning of the flags.

dir /s /b /a-d c:\basedir > list.txt

/s : process all child directories
/b : output "bare" format, just the full file paths (no size, dates, formatting, etc)
/a-d : do not output path names of the subfolders, only files contained in them (important so that you don't get lines in the output that are just folders, not actual files...)

Then specify the base folder (or drive) to start from, and an output file for the the list.


»bp
0
JohnBusiness Consultant (Owner)Commented:
Author accepted only ONE of the possible good answers here.
1
Rob HensonFinance AnalystCommented:
Subsequent text file won't open correctly in Excel if you have over 3 million files listed. Excel is limited to just over 1 million.
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.