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
)
)

コメント

Discover more from 株式会社CONFRAGE ITソリューション事業部

Subscribe now to keep reading and get access to the full archive.

Continue reading

Copied title and URL