move (移动文件并重命名文件和目录)

小猪老师 发表于 2020-08-06 08:09
浏览次数:
在手机上阅读

move命令允许用户将文件或目录从一个目录转移到另一个目录,或从一个驱动器转移到另一个驱动器。

查看英文版

目录

1 move 运行系统环境

2 move 语法

3 move 示例

move 运行系统环境

Windows 95

Windows 98

Windows xp

Windows vista

Windows 2000

Windows 7

Windows 8

Windows 10

Windows NT

Windows ME

All Versions of MS-DOS

move 语法

移动文件和重命名文件和目录。

移动一个或多个文件:

MOVE [/Y | /-Y] [drive:][path]file name1[,...] destination

要重命名目录:

MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2
[drive:][path]file name1 指定要移动的文件或文件的位置和名称。
destination 指定文件的新位置。
目标可以由驱动器符和冒号、目录名或组合组成。
如果只移动一个文件,如果希望重命名移动的文件,还可以指定目标文件名。
[drive:][path]dirname1 指定要重命名的目录。
dirname2 指定目录的新名称。
/Y 抑制确认要覆盖现有目标文件的提示。
/-Y 导致提示确认要覆盖现有目标文件。

开关/Y可能出现在COPYCMD环境变量中。
此开关可能在命令行上被/-Y覆盖。
默认协议是在重写时提示,除非从批处理脚本中执行MOVE命令。

Moves files and renames files and directories.

To move one or more files:

MOVE [/Y | /-Y] [drive:][path]file name1[,...] destination

To rename a directory:

MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2
[drive:][path]file name1 Specifies the location and name of the file or files you want to move.
destination Specifies the new location of the file. The 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 specify a destination file name, if you want the moved file to be renamed
[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 switch may be overridden with /-Y on the command line. The default protocol is to prompt on overwrites unless MOVE command is being executed from within a batch script.

查看英文版

查看中文版

move 示例

move c:\windows\temp\*.* c:\temp

将c:\windows\temp的文件移动到根目录的temp目录中,当然这是假设您有windows\temp目录的情况。
在本例中,为*。
*是通配符,告诉计算机每个文件的每个扩展名。

move "computer hope" example

如果目录名或文件名有空格,则必须用引号括起来,否则会得到“命令语法不正确”的错误消息。
上面的命令将把“computer hope”目录移动到包含在同一目录(当前目录)中的示例目录中。

move c:\example.txt h:

以上命令将example.txt文件移动到h:驱动器中。
在这个例子中,h:驱动器是一个USB闪存驱动器。
驱动器号可以根据连接到计算机的其他驱动器而变化。

move c:\windows\temp\*.* c:\temp

Move the files of c:\windows\temp to the temp directory in root, this is of course assuming you have the Windows\temp directory. In this example, *.* is wildcards telling the computer every file with every extension.

move "computer hope" example

If your directory name or file name has a space, it must be surrounded with quotes, otherwise you get a "The syntax of the command is incorrect." error message. The command above would move the "computer hope" directory into the example directory contained in the same directory (current directory).

move c:\example.txt h:

The above commands moves the file example.txt into the h: drive. In this example, the h: drive is a USB flash drive. The drive letter can vary depending on the other drives connected to the computer.

查看英文版

查看中文版

其他命令行

map | md | mem | mkdir | mklink | mode | more | move | msav | msbackup | mscdex | msd | msg |

如此好文,分享给朋友