Determine if the file size is zero at the command prompt (batch)

Determine if the file size is zero at the command prompt (batch)

Use %%~zF to determine if the file size is zero at the command prompt. A for statement is also used to determine this.
The following is a sample source.

for %%F in (test.log) do (
REM If 0 byte, normal termination
if %%~zF==0 (
exit 0
) else (
exit 1
)
)

コメント

タイトルとURLをコピーしました