I'm working on a batch-script which first counts all files in a directory and then creates a colum like the one blow for every file. For example if there are 11 files there are 11 Columns with the exception that X is replaced by an ascending number.
Code: Select all
---------------------------------------------------------------------------
File X
---------------------------------------------------------------------------
File-Name...............:
File-Size...............:
---------------------------------------------------------------------------
The Code I have so far is this:
Code: Select all
echo off
for /f "delims=|" %%f in ('dir /b %CD%') do (
setlocal
set file="%%f"
set maxbytesize=1000
FOR /F "usebackq" %%A IN ('%file%') DO set size=%%~zA
echo ---------------------------------------------------------------------------
echo File X
echo ---------------------------------------------------------------------------
echo\
echo File-Name...............: %%f
echo File-Size...............: %size%
echo\
echo ---------------------------------------------------------------------------
)> text.txt
exit