I have a Windows batch file utilized in my Visual Studio tool chain that creates a list of files in a particular directory, and then uses "findstr" to narrow this list down to only the files whose names contain a particular string; and then does some work on these files.
dir /b \mypath*.wav >wavRawList.txt
findstr /b /v "DesiredString" wavRawList.txt >wavListWithDesiredString.txt
for /f %%a in (wavListWithDesiredString.txt) do (
[... do some stuff ...]
)
Visual Studio frequently reports errors from this batch file, and I think it's because wavListWithDesiredString.txt frequently ends up being a file with a length of 0. Is there a variety of "if exist wavListWithDesiredString.txt" where instead of "exist" I can substitute a command meaning "if it exists and its file length is greater than 0"?