Bat file to get File size in human readable format
There is an example of Bat file which can give output of file size in human readable format (Value with KB / MB etc ). This bat file is good with some copying / backup bat files. Here you will get the file size in variable called %size% . You can test the script by giving and input variable for %file%.
echo off
set /p file= Type your file name :
for /f “tokens=4 ” %%a in (‘dir /a-d/-c %file% ^| findstr /e %file%’) do set size=%%a
set /a KB=(%size%/1024)
echo %KB% KB
set /a MB=(%size%/1024)/1024
Echo %MB% MB
pause
Leave a Reply
487 views, 4 so far today |
Tweet






