@echo off if [%1]==[] goto help rem This checks CX register for the size. Actually, this rem only gets the lower 16 bits of size (64k). For rem files above 64k in size, you might want to get rem the BX value as well (the upper 16 bits). goto START :START :: build the debug script rem rcx gets the CX register, rbx would get the BX register echo rcx>script rem a blank line says we don't want to change the value echo.>>script rem q will quit the debug program echo q>>script :: build cx.bat echo echo File size is %%1 bytes hex > cx.bat :: run debug to create temp.bat type script | debug %1 | find "CX" > temp.bat call temp.bat :: cleanup del script > nul del temp.bat > nul goto DONE :HELP echo Pass a file name as an argument, this echo program will return the size in hex goto DONE :DONE :: http://www.ericphelps.com