Help Creating an Index of Files

G

Guest

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
 
J

Jerold Schulman

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%
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top