[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文件操作] docmd - 文件匹配与处理工具

docmd @FILE -i -r -s -t -path=PATH -mode=df -cmd=CMD -cond=EXPR -ext=FILE -EXEC
pattern...
Builds (and optionally executes) a command for selected files and directories

  @FILE       read switches and/or patterns from file FILE. If used, this
              should be the first argument. (Values given explicitly on the
              command line later on override values in FILE.)
  -i          invert result of pattern matching  (on a per-pattern basis)
  -r          pattern is a regular expression
  -s          recurse into subdirectories
  -t          print parsed -cond expression and/or -cmd command and exit
  -v          print version information and exit
  -path=PATH  path to process; defaults to current directory (ie .\)
  -mode=MODE  f to process files, d to process directories (default is df)
  -ext=FILE   load extension code
  -cmd=CMD    command to build for matching files/directories. If the argument
              contains spaces or other special characters the whole switch has
              to be enclosed in double quotes. If no explicit command is given
              matching file and directory names are simply printed.
              -cmd=help will print a short help screen for this option.
  -cond=EXPR  expression to select entries by date or time stamps, attributes,
              size etc. If the expression contains spaces or other special
              characters the whole switch has to be enclosed in double quotes.
              -cond=help will print a short help screen for this option.
  -EXEC       execute the resulting command line (use with care)

  pattern     one or more filename(s), wildcard pattern(s) or regular
  (or @LIST)  expression(s). A wildcard pattern can contain more than one
              wildcard expression; these have to separated by semicolons
              (ie "*.exe;*.dll" will search for .exe and .dll files).
              (If preceded by @ this can also be a file with a list of file
              and/or directory names to process.)

  If -EXEC is specified then the command given in -cmd= is executed for every
  file/directory matching the pattern (and, if given, the -cond= expression);
  otherwise the resulting command line is simply written to stdout (this can
  be redirected to produce an @filelist or a batch file).

  Example: docmd -s -path=c:\ -mode=d "-cmd=pkzip $'$(file)\zipped.zip$' $'$(fil
e)\*$'" *
  This puts all files, per directory, into zipped.zip, starting with c:\.



一些例子:
  1. docmd -i -mode=f *.exe
复制代码
        列出所有非 *.exe 文件
  1. docmd -r "\d{2,}" *
复制代码
        列出文件名中含有两个以上数字的文件及文件夹
  1. docmd -mode=f "-cond=size>20*1024" *
复制代码
        列出大于 20 KB 的文件
  1. docmd -mode=f "-cond=size in (20*1024, 30*1024)" *
复制代码
        列出文件大小介于 20-30 KB 的文件
  1. docmd -mode=f "-cond=cdate!=today" *
复制代码
        列出不是今天创建的文件

...

---------------------------------------
官网: http://thomaslauer.com/comp/docmd
---------------------------------------

http://bcn.bathome.net/s/tool/index.html?key=docmd

外国人的东西语法真乱...
360报毒啊

TOP

TOP

回复 2# ht河豚


    我这里没有报

TOP

回复  ht河豚


    我这里没有报
CrLf 发表于 2013-3-24 22:29


你居然也用数字!

TOP

回复 5# Demon


    嘿嘿,很2b很流氓的软件,但是省事啊,我可是懒人

TOP

回复  Demon


    嘿嘿,很2b很流氓的软件,但是省事啊,我可是懒人
CrLf 发表于 2013-3-26 00:55



致以我最深切的鄙视

TOP

致以我最深切的鄙视
Demon 发表于 2013-3-26 13:17



    +1...
---学无止境---

TOP

回复 2# ht河豚
360果断卸……

TOP

回复 2# ht河豚


    具体哪里乱?
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

返回列表