This is my script, what it does is count lines from cpp, h, hpp, cs, c files in the current folder.
What I want to do is also counted in subfolders, but it seems to me that I cannot do this.
I have made several recursion attempts, but I cannot implement it in the current code.
call::CountLines Modules\Output\HTML.Tidy\
goto:eof
:CountLines
setlocal
set /a totalNumLines = 0
SETLOCAL ENABLEDELAYEDEXPANSION
for /r %%f in (%~1*.cpp %~1*.h %~1*.hpp %~1*.cs %~1*.c) do (
for /f %%C in ('Find /V /C "" ^< %%f') do set Count=%%C
set /a totalNumLines+=!Count!
)
echo Total number of cod lines for %~1: %totalNumLines% >> log.txt
Please let me know if you know a solution or a better way.
Hello,
Stephen
source
share