【批处理】使用批处理、Bat 比较指定文件大小

admin 2021年4月3日18:57:43评论86 views字数 1094阅读3分38秒阅读模式

使用批处理、Bat 比较指定文件大小:

for %%a in (qq.exe) do if %%~za EQU 88888 echo 文件怎么怎么...

    以上代码含义为,如果文件“QQ.exe”大小不等于88888字节,则显示“文件怎么怎么...”,具体参数,请查看下表。我用相同的颜色表示了参数对应的具体参数列表。

%~I         - expands %I removing any surrounding quotes (")
%~fI        - expands %I to a fully qualified path name
%~dI        - expands %I to a drive letter only
%~pI        - expands %I to a path only
%~nI        - expands %I to a file name only
%~xI        - expands %I to a file extension only
%~sI        - expanded path contains short names only
%~aI        - expands %I to file attributes of file
%~tI        - expands %I to date/time of file
%~zI        - expands %I to size of file
%~$PATH:I   - searches the directories listed in the PATH
               environment variable and expands %I to the
               fully qualified name of the first one found.
               If the environment variable name is not
               defined or the file is not found by the
               search, then this modifier expands to the
               empty string

文件比较操作:
    EQU - 等于
    NEQ - 不等于
    LSS - 小于
    LEQ - 小于或等于
    GTR - 大于
    GEQ - 大于或等于

    使用批处理、Bat 比较指定文件大小,使用批处理比较指定文件大小,使用Bat 比较指定文件大小,使用批处理比较文件大小,使用Bat 比较文件大小,使用批处理比较文件,使用Bat 比较文件,批处理比较文件,Bat 比较文件,批处理比较,Bat 比较。

文章来源于lcx.cc:【批处理】使用批处理、Bat 比较指定文件大小

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年4月3日18:57:43
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【批处理】使用批处理、Bat 比较指定文件大小http://cn-sec.com/archives/319390.html

发表评论

匿名网友 填写信息