Showing posts with label File size in bytes using command prompt. Show all posts
Showing posts with label File size in bytes using command prompt. Show all posts

Friday, September 28, 2007

File size in bytes using command prompt

How do I get the size of a file in bytes (purely in numbers) on Command prompt:

After much R&D I got to the following command:

FOR /F "usebackq delims==" %i in (`dir /b for.txt`) do %~zi


The last part after do can be replaced by SET %~zI = %size etc.. to use this in the batch files.
The delimitter is backq, i.e. ` and not '

Share on Facebook