List Directory with time stamp

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Maheshp
Posts: 6
Joined: 25 Jul 2011 20:22

List Directory with time stamp

#1 Post by Maheshp » 03 Jan 2012 11:13

i want to prepare list of all excel files on a particular drive(e.g C:\)
i use dir /s /b c:\*.xls > filelist.xls this syntex
but it does not give date & time details
is any way i will get output with last modified date in excel sheet in below format
c:\abc.xls 03-01-2012 21:52:36
http://www.74mph.com/faq/FAQ00142.html

Squashman
Expert
Posts: 4479
Joined: 23 Dec 2011 13:59

Re: List Directory with time stamp

#2 Post by Squashman » 03 Jan 2012 11:40

Code: Select all

for /f "tokens=*" %%I in ('dir /a-d /b /s *.xls') do echo %%~dpnxI,%%~tI >>filelist.csv

Maheshp
Posts: 6
Joined: 25 Jul 2011 20:22

Re: List Directory with time stamp

#3 Post by Maheshp » 04 Jan 2012 10:09

Thank u so much...! Squashman
Appreciate your time & Help...! :P

Post Reply