How to get a Windows directory listing including full sub-folders in path, and the creation date

I'm trying to print a Windows directory listing including the full sub-folder paths and creation date along with the file name.

Something like this, when run from say folder C:\TEMP:
28/02/2015       C:\TEMP\Blogs\test1.doc  
22/02/2015       C:\TEMP\Blogs\test2.txt  
22/02/2015       C:\TEMP\Pics\test1.xls    
28/02/2014       C:\TEMP\Pics\Sept\test2.jpg

If I could add a date display to the command   'dir /b /s '   it would give me what I want, I've tried /T:C as a guess but this does nothing.

There are some downloadable programs that would do the trick, but i need the command line/s or code as can't install any software on the system.

PS this is my first question so I hope it's OK, thank you if you can help
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Hi Sharonera, and welcome to Expert Exchange

You question his well describe.

You can probable start to look at this bellow link:
Printing Directory Listings from Windows File Manager

Another way, would be to install Print Directory 2011
Print Directory 2011

Official site:

This will help you to print:
Simple file list, the directory and full folder tree, the details list of the file attribute etc..

Is this what you are looking for?
Otherwise, you can always go with command prompt:

dir /s >filename.txt

Open in new window

It should give you something like this in a text file:

Directory of C:\Users\Wilder1626\AppData\Local\Adobe

2015-02-22  04:05 PM    <DIR>          .
2015-02-22  04:05 PM    <DIR>          ..
2015-02-22  04:05 PM    <DIR>          Acrobat
2015-02-22  04:05 PM    <DIR>          Color
               0 File(s)              0 bytes
☠ MASQ ☠Commented:
I may have missed something but would

Dir <name of folder> /s > C:\<location you want file saved>dir.txt

work for you?

It could generate a huge textfile though if you've lots of subfolders - you can limit how far down the tree this goes by adding a number after the '/s'
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Sorry. I gave you an application also, even if you said that you were not able to install any. But look at all other options.
SharoneraAuthor Commented:
Hi ,   Thanks for your responses!     Jean-Marc, thanks I'd tried the link you suggested but nothing there gave it to me.  And yes,  applications are out unfortunately as I can't install anything.

MASQ,   thanks  but I do need the full path including the subfolders, filename and create date on the same line,  not subfolders on separate lines above.  Reason is I'm going to import it into a program that will point to the files

The command  '  Dir  /b  /s  > list.txt   ' gives me what I need but without the date (see output test below)  however I need the date as well.  

Dir  ????   how do I get this ?  
28/02/2015       C:\TEMP\Blogs\test1.doc  
22/02/2015       C:\TEMP\Blogs\test2.txt  
22/02/2015       C:\TEMP\Pics\test1.xls    
28/02/2014       C:\TEMP\Pics\Sept\test2.jpg

Much appreciate any ideas , thanks
Bill PrewIT / Software Engineering ConsultantCommented:
Here's a simple VBS approach, outputs in CSV format, so just pipe to a file and open in Excel.

cscript //nologo yourname.vbs > list.csv

' Specify folder to list folder from
sFolder = "c:\temp"

' Write header line
Wscript.Echo "Path,DateCreated,DateLastModified,DateLastModified"

' Create file system object
Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")

' Call recursive subroutine to list all files under this folder (and subfolders)
Set oFolder = oFSO.GetFolder(sFolder)

' Process all folders in this folders
For Each oSubFolder In oFolder.Subfolders
   Wscript.Echo Quote(oSubFolder.Path) & "," & _
                oSubFolder.DateCreated & "," & _
                oSubFolder.DateLastAccessed & "," & _

' Add surrounding double quotes to a string
Function Quote(s)
   Quote = Chr(34) & s & Chr(34)
End Function

Open in new window

Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
If exported to .csv the results wont get truncated
get-childitem c:\windows -recurse  | select @{Name="Date";Expression={$_.creationtime.tostring('yyyy-MM-dd') } }, Fullname | export-csv c:\temp\windowsfiles.csv -NoTypeInformation

Open in new window

Batch one-liner; directly for the cmd console:
(for /f "delims=" %a in ('dir /s /b "C:\Temp"') do @echo "%~ta","%a")>list.txt

Open in new window

For a batch script, double up on the "%":
(for /f "delims=" %%a in ('dir /s /b "C:\Temp"') do @echo "%%~ta","%%a")>list.txt

Open in new window


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
Steve KnightIT ConsultancyCommented:
Was going to suggest batch but oBdA got there first... add an /a-d to the dir command to save it showing directories and their time stamps too, just files i.e.

(for /f "delims=" %%a in ('dir /s /b /a-d "C:\Temp"') do @echo "%%~ta","%%a")>list.txt

It will show you the date and time stamp in whatever way the current date & time is.

HI Sharonera

I'm may not be the biggest expert on this topic, but you may want o test this.

You need to run CMD as an Administrator like below and type:
run as administrator
Dir c:\ /s >Directory.txt

Open in new window


Then, search for your file: Directory.txt. You will see your result like below.
SharoneraAuthor Commented:
THANK YOU so much every one,  I'm thrilled to get this help.  

OBdA & Steve,  your command one-liners in batch file did exactly what I needed - thank you!!    I'll use the option to exclude the folder-only lines as an added-plus!  

Very much appreciated,  
SharoneraAuthor Commented:
Oh oh first time user here.   I expected to be able to allocate a Multiple Solution to Steve after accepting OBda's solution that was first.     But it's greyed out now -  sorry I'll know for next time!
Bill PrewIT / Software Engineering ConsultantCommented:
I cancelled the accepted single answer, go ahead and close with multiple solutions as you desired.

Steve KnightIT ConsultancyCommented:
Wasn't a problem anyway, but thanks if you do.

Have a look at set /? and for /? For some of the other options. Effectively you are making a dir output of all you want to see them processing it a line at a time with for and showing different bits of the filename, e.g. you can get size, date, filename, extension, path etc. too and easily add in commas etc to make a CSV file as he did.

Good luck with it and welcome to EE!

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.