DOS批处理文件移动与给定的Word文件在他们的名字 [英] DOS batch file to move files with a given word in their name

查看:201
本文介绍了DOS批处理文件移动与给定的Word文件在他们的名字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有文件的集合在Windows一个目录,例如:

I have a collection of files in one directory in Windows, for example:

"file 01 WP2001.pdf"
"file 02 WP2012.pdf"
"file 03 AR2009.pdf"

我想移动的所有文件以字符串WP(区分大小写)在他们的名字(即文件01和02),以现有文件夹。

I'd like to move all files with the string "WP" (case sensitive) in the their name (that is, files 01 and 02) to an existing folder.

推荐答案

从一个批处理文件中

for /f "eol=: delims=" %%F in ('dir /b^|find "WP"') do move /Y "%%F" "someFolder"

如果在命令行中运行,然后更改%% F到%F

If run from the command line, then change %%F to %F

这篇关于DOS批处理文件移动与给定的Word文件在他们的名字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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