本文介绍了如何使用命令行将所有文件从一个文件夹移动到另一个文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将所有文件从一个文件夹移动到另一个文件夹的最佳命令是什么?
What is the best command to move all files from one folder to another?
我想从批处理文件中执行此操作.
I want to do this from within a batch file.
推荐答案
您可以为此使用 move
.help move
中的文档指出:
You can use move
for this. The documentation from help move
states:
Moves files and renames files and directories.
To move one or more files:
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination
To rename a directory:
MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2
[drive:][path]filename1 Specifies the location and name of the file
or files you want to move.
destination Specifies the new location of the file. Destination
can consist of a drive letter and colon, a
directory name, or a combination. If you are moving
only one file, you can also include a filename if
you want to rename the file when you move it.
[drive:][path]dirname1 Specifies the directory you want to rename.
dirname2 Specifies the new name of the directory.
/Y Suppresses prompting to confirm you want to
overwrite an existing destination file.
/-Y Causes prompting to confirm you want to overwrite
an existing destination file.
The switch /Y may be present in the COPYCMD environment variable.
This may be overridden with /-Y on the command line. Default is
to prompt on overwrites unless MOVE command is being executed from
within a batch script.
有关示例,请参阅以下脚本,其中最初将 qq1
和 qq2
目录分别显示为具有三个文件和没有文件.然后,我们执行move
,我们发现三个文件已经按预期从qq1
移动到qq2
.
See the following transcript for an example where it initially shows the qq1
and qq2
directories as having three and no files respectively. Then, we do the move
and we find that the three files have been moved from qq1
to qq2
as expected.
C:Documents and SettingsPaxMy Documents>dir qq1
Volume in drive C is Primary
Volume Serial Number is 04F7-0E7B
Directory of C:Documents and SettingsPaxMy Documentsqq1
20/01/2011 11:36 AM <DIR> .
20/01/2011 11:36 AM <DIR> ..
20/01/2011 11:36 AM 13 xx1
20/01/2011 11:36 AM 13 xx2
20/01/2011 11:36 AM 13 xx3
3 File(s) 39 bytes
2 Dir(s) 20,092,547,072 bytes free
C:Documents and SettingsPaxMy Documents>dir qq2
Volume in drive C is Primary
Volume Serial Number is 04F7-0E7B
Directory of C:Documents and SettingsPaxMy Documentsqq2
20/01/2011 11:36 AM <DIR> .
20/01/2011 11:36 AM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 20,092,547,072 bytes free
C:Documents and SettingsPaxMy Documents>move qq1* qq2
C:Documents and SettingsPaxMy Documentsqq1xx1
C:Documents and SettingsPaxMy Documentsqq1xx2
C:Documents and SettingsPaxMy Documentsqq1xx3
C:Documents and SettingsPaxMy Documents>dir qq1
Volume in drive C is Primary
Volume Serial Number is 04F7-0E7B
Directory of C:Documents and SettingsPaxMy Documentsqq1
20/01/2011 11:37 AM <DIR> .
20/01/2011 11:37 AM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 20,092,547,072 bytes free
C:Documents and SettingsPaxMy Documents>dir qq2
Volume in drive C is Primary
Volume Serial Number is 04F7-0E7B
Directory of C:Documents and SettingsPaxMy Documentsqq2
20/01/2011 11:37 AM <DIR> .
20/01/2011 11:37 AM <DIR> ..
20/01/2011 11:36 AM 13 xx1
20/01/2011 11:36 AM 13 xx2
20/01/2011 11:36 AM 13 xx3
3 File(s) 39 bytes
2 Dir(s) 20,092,547,072 bytes free
这篇关于如何使用命令行将所有文件从一个文件夹移动到另一个文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!