I have a folder where files are dumped with timestamps...
filename\_ver20130405121320.csv

I wish to create a batch script that makes sure 5 files have been created with todays date.

im guessing i will need to use a for loop with a date limit of today.

```
FOR /r %foldername% %%g IN (*.csv) DO (
    echo %%~nxg 
)

```

using a forfiles statement lists the files, is it possible to use a counter and +=1 every time it displays a filename?

```
forfiles /S /P %foldername% /m *.csv /d 0 

```

the logic is 

```
if number of files in a foldername is less than 5 where file created is today

echo error! missing files

```

any help would be much appreciated

date returned on machine as Mon 22/07/2013
use this to set date 

```
:: set date 
FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET dd=%%B
FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET mm=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B
SET setDate=%dd%/%mm%/%yyyy%

```