How does a Windows batch file detect that a file is > 0 bytes? -
I have a windows batch file that has been used in my visual studio tool series that lists the files in a particular directory , And then uses "searchstrokes" to restrict this list to only those files, whose names contain a specific string; And then some works on these files.
dir / b \ mypath \ *. Wav & gt; WavRawList.txt searchR / b / v "desiredString" wavRawList.txt & gt; WavListWithDesiredString.txt / B>
Visual Studio often reports errors from this batch file, and I think it's because wavListWithDesiredString.txt often ends up having files with a length of 0 it happens. Are there many types of "wavListWithDesiredString.txt" where I can change the meaning of an order instead of "exist" which means "if it exists and its file length is more than 0
For more or less inline ways, for
:
In% x (wavListWithDesiredString.txt), do not %% ~ zx == 0 (...)
Or you can use a sub-rootin:
: size set size =% ~ z1 goto: eof
that you can call like this Are:
Call: Size wavList WithDesiredString.txt if not% SIZE% == 0 ...
Comments
Post a Comment