Windows command for file size only

后端 未结 12 1974
死守一世寂寞
死守一世寂寞 2020-11-27 16:12

Is there a Windows command that will output the size in bytes of a specified file like this?

> filesize test.jpg
65212

I know that the d

12条回答
  •  时光说笑
    2020-11-27 16:45

    Since you're using Windows XP, Windows PowerShell is an option.

    (Get-Item filespec ).Length 
    

    or as a function

    function Get-FileLength { (Get-Item $args).Length }
    Get-FileLength filespec
    

提交回复
热议问题