1.

Solve : Batch File Help, using a wildcard(dynamic) directory?

Answer»

Hello! I need to count the NUMBER of files in a directory where one of the layers is dynamic, MEANING C:\level1\level2\{dynamic directory}\error. So, I need to count the amount of files in the error directory and they SAVE it to a text file. There are only 2 directories in the "dynamic" directory.I guess I would do something like this.
Code: [Select]pushd C:\Level1\Level2
for /F "tokens=*" %%G in ('dir /ad /b /s error') do for /f "tokens=1 delims= " %%I in ('dir /a-d %%G ^| find "File(s)"') do echo %%I>errorfilecount.txt



Discussion

No Comment Found