Getting file size in KB using batch file

To get file size using batch file, we use variable with modifier. Then set /a, performs match operation (divide by 1024). Unlike other examples, this example works on any Windows language. @echo off :: Name: file_size.bat :: Author wishmesh.com :: Calculate file size in KB from %1 set /a size = %~z1 / 1024 echo …