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
Omar SoudaniSenior System EngineerCommented:
Open command line and use this:

dir /a /s /b > filelist.txt  

you can open the file using excel when done.

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.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Bill PrewIT / Software Engineering ConsultantCommented:
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.

JohnBusiness Consultant (Owner)Commented:
Author accepted only ONE of the possible good answers here.
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.
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.