Help Creating an Index of Files

AJ

Distinguished
Apr 1, 2004
288
0
18,780
Archived from groups: microsoft.public.win2000.general (More info?)

I need to prepare a report which contains the List of All the files in an
Directory and All of its subdirectories.The details which I need is file
size, name, date last accessed,location etc. Now the Dir command give me this
info but since I need the Info in an Excel file and the text file created in
my case is around 27 MB you can Understand my plight of copying and pasting
all the data fron .txt to xls . All I need is and freeware /Microsoft/
Shareware tool which can give me a listing of all the file in a directory and
its subseqent subdirectories along wih relevent info but the tool shoul have
option to provide output in Excel.
Please advise

Regards
Ajay
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

On Mon, 25 Jul 2005 04:02:02 -0700, "Aj" <Aj@discussions.microsoft.com> wrote:

>I need to prepare a report which contains the List of All the files in an
>Directory and All of its subdirectories.The details which I need is file
>size, name, date last accessed,location etc. Now the Dir command give me this
>info but since I need the Info in an Excel file and the text file created in
>my case is around 27 MB you can Understand my plight of copying and pasting
>all the data fron .txt to xls . All I need is and freeware /Microsoft/
>Shareware tool which can give me a listing of all the file in a directory and
>its subseqent subdirectories along wih relevent info but the tool shoul have
>option to provide output in Excel.
> Please advise
>
>Regards
>Ajay


Import the CSV file created by the following script.

@echo off
if {%2}=={} @echo Syntax: FileRpt Folder ReportFile&goto :EOF
setlocal
set folder=%1
set report=%2
for /f "Tokens=*" %%f in ('dir %folder% /b /s') do (
call :rpt "%%f"
)
endlocal
goto :EOF
:rpt
set fn="%~nx1"
set loc="%~dp1"
set sz="%~z1%"
for /f "Tokens=1" %%d in ('dir %1 /TA^|find "/"') do set dt="%%d"
@echo %fn%,%loc%,%sz%,%dt%>>%report%