批处理文件将文件移动到另一个目录 [英] Batch file to move files to another directory

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

问题描述

我希望你能帮助我这一个。它可能已被要求多次已经(我知道),但由于某些原因,我不能有工作。

I hope that you can help me with this one. It might have been asked multiple times already (I know that), but for some reason, I just can't have it working.

我想一些文件从文件目录移动到根目录。

I want to move some files from the "files" directory to the root directory.

所以文件,例如:

test1.txt test2.txt test3.zip test4.zip test5.exe test6.exe

我想将这些文件移动到不同的目录中。

I want these files to be moved to different directories.

所以我用这样的:

move files\*.txt ..\txt /q
move files\*.zip ..\zip /q
move files\*.exe ..\exe /q

不过,我总是得到错误。它无法找到文件,然后在CMD停止工作。

But I always get errors. It can't find the files and then the CMD stops working.

感谢。

编辑:

它的工作是这样的:

move /y .\files\*.txt ..\txt
move /y .\files\*.zip ..\zip
move /y .\files\*.exe ..\exe

但现在不会将文件移动到父目录。

But now it won't move the file to the parent directory.

推荐答案

/ q是不是一个有效参数。
/ Y:燮presses提示确认是否覆盖

/q isn't a valid parameter. /y: Suppresses prompting to confirm overwriting

此外.. \\ TXT意味着父目录,而不是根目录下的目录TXT。
根目录是:\\
并请注明你的错误

Also ..\txt means directory txt under the parent directory, not the root directory. The root directory would be: \ And please mention the error you get

尝试:

move files\*.txt \ 

编辑:
尝试:

Try:

move \files\*.txt \ 

编辑2:

move C:\files\*.txt C:\txt

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

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