Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Full Path directory listing including date timestamp

Status
Not open for further replies.

mutley1

MIS
Jul 24, 2003
909
Hi All,

I'm not sure if this is the right forum, but closest I could fine. I'm analysing a server and want to create a list from a DIR command to show all files in a particular folder and subfolders (dir /s /b) but also include the date and time stamp in the listing - preferably all on 1 line (it's going into a database table).

I can't seem to get the date and time in when getting the full path name in the output.

Can anyone help please?

Thanks in advance,

M.
 
You must not be "looking" very hard. ;-)

Open a command prompt and typeDIR /? to get a list of available switches.

You can display the creation date or last modified date or last written date.

To get a directory listing with createion date you use
dir /T:C

To pipe it to a file use
dir /T:C >dirlist.txt

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Thanks Mark,

Yip - I am looking far and wide.....:)

I can't seem to get the date and time in when getting the full path name in the output.

dir /b /s gives the FULL PATH / FILE NAME.....I want to get the date time stamp for the individual files as well. Not interested in folder create times....the file creation date and the full path.

E.g.

06/01/2006 10:45 C:\mydir\subdir\executable.exe
07/01/2006 11:34 C:\mydir\subdir2\document.doc

for all files in a directory including subdirectories.

Cheers,

M.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top