I'm doing some cleaning on my office shared directory and i would like to create a directory list that shows file name and size , hopefully one line for each file. Maybe a batch file that sends the information to a CSV file. would like the file to look something like this: /myfolder/subfolder/myfile.txt - 564k /myfolder/subfolder/Newfile.doc - 56k
@echo off & setlocal EnableDelayedExpansion
type nul > "FileList.txt"
for /F "delims=" %%A in ('dir /S /B /A-D "Your_Directory"') do (
set /A size/=1024
echo.!file! - !size!K >> "FileList.txt"
To generate a .csv file is possible but requires the *exact* layout wished.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Compnet Ventures, LLC hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.