I have two lines of code which work individually . . .
Code: Select all
for /f "tokens=*" %%A in ('dir /b /a:-d') do echo %%~nxA %%~zA >> "Folders_Files.txt"
Code: Select all
dir /b /a:-d | findstr /v /i "Folders_Files.txt List_Folder_Files_1.bat" >> "Folders_Files.txt"
Thanks in advance.
EDIT1:
Cracked it . . .
Code: Select all
for /f "tokens=*" %%A in ('dir /b /a:-d ^| findstr /v /i "Folders_Files.txt List_Folder_Files_1.bat"') do echo %%~nxA %%~zA >> "Folders_Files.txt"
I am also going to try and work in a count for the number of files!
EDIT2:
Cracked the count part . . .
Code: Select all
set /a count=0
for /f "tokens=*" %%A in ('dir /b /a:-d ^| findstr /v /i "Folders_Files.txt List_Folder_Files_2.bat"') do (
set /a count+=1
echo %%~nxA %%~zA >> "Folders_Files.txt"
)
echo. >> "Folders_Files.txt" & echo Total files: %count% >> "Folders_Files.txt"