File Size in Bytes

Use FOR command to determine the file size in bytes.

Description: Use the `z` specifier of FOR variable references to get the size of a file.
Script:
1.
2.
set "filename=myfile.txt"
for %%A in (%filename%) do echo.Size of "%%A" is %%~zA bytes
Script Output:
 DOS Script Output
Size of "myfile.txt" is 57006 bytes