Batch DOS – How to echo filesize of each file

Send Us a Sign! (Contact Us!)
This article has been published [fromdate]
[readtime]

To view the filesize of each file in the current directory (in this example .txt text files) you can use this “loop” (FOR):

@echo off
for /f "tokens=*" %%A in ('dir /b *.txt') DO (echo %%~zA)
pause >nul

Enjoy.

LANGUAGE
ENGLISH