Windows命令只有文件大小? [英] Windows command for file size only?

查看:132
本文介绍了Windows命令只有文件大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有Windows命令将输出像这样的指定文件的字节大小?

 > .jpg 
65212

我知道dir命令输出此信息,信息也。



我可以轻松地编写这样的程序,但我更喜欢使用本机Windows命令,如果可能的话,或只有在新安装的Windows XP 。

解决方案

如果你在批处理脚本中,可以使用参数变量技巧获取文件大小:



filesize.bat:

  @echo off 
echo%〜z1

这会得到类似您在问题中建议的结果。



类型

 帮助调用

在所有疯狂的变量操作选项的命令提示符。另请参阅
此选项仅适用于Windows 2000及更高版本




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 dir command outputs this information, but it outputs other information also.

I could easily write such a program but I would prefer to use a native Windows command if possible, or only what is available in a fresh install of Windows XP.

解决方案

If you are inside a batch script, you can use argument variable tricks to get the filesize:

filesize.bat:

@echo off
echo %~z1

This gives results like the ones you suggest in your question.

Type

help call

at the command prompt for all of the crazy variable manipulation options. Also see this article for more information.

Edit: This only works in Windows 2000 and later

这篇关于Windows命令只有文件大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆