将所有文件移动到另一个文件夹,但有例外 [英] Move all file to another folder with exception

查看:138
本文介绍了将所有文件移动到另一个文件夹,但有例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试使用批处理文件作为命令将文件从当前文件夹移动到另一个文件夹.根据我在Internet上搜索的内容,我找到了一种移动文件夹中所有文件或文件夹中所有相同扩展名的方法.但是我找不到在带有异常文件的文件夹中移动任何内容的方法.

例如,假设在一个文件夹中,我有20 * .txt文件,15 * .dll文件,30 * .pdf文件,2 * .exe文件和1 * .ini文件..所以我有一个选项到:

Hi all,

I''m trying to use batch file as command to move file from current folder to another folder. From what I search in Internet, I''ve found a way to move all file in folder or all same extension in a folder. But I''m not found the way to move anything in folder but with exception file.

For example, let''s say in a folder, I have 20 *.txt file, 15 *.dll file, 30 *.pdf file, 2 *.exe file and 1 *.ini file..so I have an options to:

move D:\MyFolder\*







OR

move D:\MyFolder\*.txt
move D:\MyFolder\*.dll
move D:\MyFolder\*.pdf
move D:\MyFolder\*.exe



这里的情况是我要使用移动D:\ MyFolder \ *,但我不想移动.ini文件,这意味着它将移动* .ini文件以外的所有内容.



Case here is I want to use move D:\MyFolder\* but I don''t want to move the .ini file which means it will move all the content except *.ini file. Could someone tell me how to complete this?

推荐答案

您可以使用通配符(正则表达式模式)来移动特定文件.
此线程 [
You can use wildcards (regex patters etc) to move particular files.
This thread[^] might answer your query.


这篇关于将所有文件移动到另一个文件夹,但有例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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