Advertisement
Guest User

Untitled

a guest
Apr 27th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. @echo off
  2. REM Written by Segi Hovav 04/18/16
  3. REM
  4. REM Count the total number of lines in all eBase scripts
  5. setlocal EnableDelayedExpansion
  6.  
  7. set basePath=C:\ebaseXi5\Workspace\
  8. set showDetails=0
  9.  
  10. REM Change to Ebase Workspace
  11. cd /d %basePath%
  12.  
  13. REM Generate the list of all scripts in the current workspace
  14. dir /b /s | find "Scripts\" > scriptlist.txt
  15.  
  16. Set /a _Lines=0
  17.  
  18. REM Loop through each line in scriptlist.txt
  19. for /F "tokens=*" %%A in (scriptlist.txt) do (
  20. REM count the # of line in the current file
  21. For /f %%j in ('Type "%%A"^|Find "" /v /c') do (
  22. Set /a _Lines=!_Lines! + %%j
  23.  
  24. REM Display the details
  25. If %showDetails% == 1 (
  26. set tmpname=%%A
  27. echo Processing file !tmpname:~22! which has %%j lines
  28. )
  29. )
  30. )
  31.  
  32. echo The total line count is !_Lines! lines
  33. pause
  34.  
  35. del scriptlist.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement