I'm not going to make the script for you but I'm give you the methods for what you want. First let's split the question in two parts:
1.- Get line count in Dir
for /f "usebackq tokens=1 delims=," %%a in ("you_file_path") do set /a count+=1
and to get firt row after header you would do that but with a loop break
for /f "usebackq tokens=1 delims=," %%a in ("you_file_path") do (
set /a count+=1 && if count==2 (first_row=%%a && goto next)
)
:next
2.- Modified Date
for /f "tokens=1,2 delims= " %%a in (
'dir "FullDirPath" ^| find /i "File_name"'
) do set ArchDate=%%a
Now is up to you to glue this together and make a script, you would need to loop every file using the above code and at the end of each loop echo "%first_row%" "%archdate%" "%count%"
or echo "%first_row%" "%archdate%" "%count%" > file.txt
You can test this methods in cmd
but to make use of variables on the terminal you need to replace %%a
for %a
. On a batch script is %%a
is the right syntax, but on the terminal %a
is the right sintax.
Cheers.