Difference between revisions of "Batch FileSize Query"
From scripting
(Created page with "To obtain the [http://www.sproutseo.com seo services] size of a file with Batch (.bat) syntax, use [http://www.sproutseo.com seo services] the following characters: ~z This...") |
(No difference)
|
Revision as of 04:53, 22 April 2017
To obtain the seo services size of a file with Batch (.bat) syntax, use seo services the following characters:
~z
This can be confusing, because this must be placed between the variable signifier (%) acting corps and the variable characters.
Example:
online reputation management for %%I in (queue.txt) Do ( echo %%~zI IF %%~zI LEQ 2 ( echo "Less than..." exit /b ) ELSE ( echo "Greater than..." exit /b ) )
Explanation: The variable being used is
%%I
It is querying the text file named queue.txt and to extract the file size property from it, wedge in the
~z
When combining them, you get:
%%~zI
This combination extracts the file size as an integer.
[Category:Batch Files]