【发布时间】:2013-07-09 05:34:57
【问题描述】:
首先我是初学者。我想创建批处理文件来搜索特定文件夹(包括所有它的子文件夹)并复制其中的所有文件,除了那些文件名包含某些特定字符串的文件,这就是我到目前为止所拥有的
set now=fish
set logDirectory="C:\Users\paiseha\Desktop\bb\"
for /r %logDirectory% %%i IN (*%now%*.*) do (
rem copy process goes here
)
假设我有 3 个文件
C:\Users\fareast\Desktop\bb\one.txt
C:\Users\fareast\Desktop\bb\twofishtwo.txt
C:\Users\fareast\Desktop\bb\three.txt
所以我只想复制文件 one.txt 和 three.txt,但它只复制第二个文件,我知道它是因为 *%now% *.* 那么我怎样才能把它倒过来让它反过来呢,请帮助我,在此先感谢
【问题讨论】:
标签: command-line batch-file cmd filenames