Luis Diaz
asked on
Batch: list files and folders and size in a csv file v2 (drill down or not drill down option)
Hello experts,
i use the following batch reported at: https://www.experts-exchange.com/questions/29104866/Batch-list-files-and-folders-and-size-in-a-csv-file.html?anchorAnswerId=42604039#a42604039
in order to list files and folders into a csv:
By default the procedure drill down the various files and folders.
I would like to add a flag drill down option. If Yes drill down else just list files and folders at basedir level.
If you have questions, please contact me.
i use the following batch reported at: https://www.experts-exchange.com/questions/29104866/Batch-list-files-and-folders-and-size-in-a-csv-file.html?anchorAnswerId=42604039#a42604039
in order to list files and folders into a csv:
@echo off
setlocal EnableDelayedExpansion
set BaseDir=c:\temp
set ListFile=list.csv
if exist "%ListFile%" del "%ListFile%"
echo "File_Folder_Path";"Type";"File_Folder_Size">>"%ListFile%"
for /f "tokens=*" %%A in ('dir /s /b "%BaseDir%\*.*"') do (
for %%B in ("%%~A") do (
if exist "%%~A\" (set FileType=D) else (set FileType=F)
echo "%%~A";"!FileType!";%%~zB>>"%ListFile%"
By default the procedure drill down the various files and folders.
I would like to add a flag drill down option. If Yes drill down else just list files and folders at basedir level.
If you have questions, please contact me.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Test it and it works.
Thank you very much for your help!
Thank you very much for your help!
Welcome.
»bp
»bp
ASKER
Unable to test it today I will test it tomorrow.