Counting and listing filenames

March 30, 2009 at 05:51:04
Specs: Windows XP
Hi

I have been trying to find a way to count the number of files are in a folder.

The counting part I have figured out, but combining this with a list of the files that are in a dirctory is not easy.

Can anyone help me with that

Thanx in advance.


See More: Counting and listing filenames

Report •


#1
March 30, 2009 at 06:14:57
Stated what you want to code is achieved by the native command DIR or DIR /A-D, if you just want to re-discover hot water...

:: MYDIR.BAT  Usage: mydir Folder_Name
@echo off & setlocal
pushd %*
set cnt=0
for %%j in (*) do (
  set /A cnt+=1
  echo.  %%j
)
echo.
echo.  In "%*" there are %cnt% files
popd
:: End_Of_Batch


Report •
Related Solutions


Ask Question