> DOS 中文参考手册 > move

MOVE

(move)


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

要移动至少一个文件:

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

要重命名一个目录:

MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2

  [drive:][path]filename1 指定您想移动的文件位置和名称。

  destination             指定文件的新位置。目标可包含一个驱动器号和冒号、一个目录名或组合。如果只移动一个文件并在移动时将其重命名,您还可以包括文件名。

  [drive:][path]dirname1  指定要重命名的目录。

  dirname2                指定目录的新名称。

  /Y                      取消确认改写一个现有目标文件的提示。

  /-Y                     对确认改写一个现有目标文件发出提示。

命令行开关 /Y 可以出现在 COPYCMD 环境变量中。这可以用命令行上的 /-Y 替代。默认值是,除非 MOVE 命令是从一个批脚本内执行的,改写时都发出提示。

★★★★★实例★★★★★:

假如C:\LETTERS是一个目录,如果要将当前目录中的ED.TXT和SIGRID.TXT文件移至C盘的LETTERS目录中,则在命令提示行下键入:

move ed.txt,sigrid.txt c:\letters

如果要把当前目录中的BILL.TXT文件移到C盘的LETTERS目录,并更名为ANN.TXT,可使用以下命令:

move bill.txt c:\letters\ann.txt

如果要将C盘上的THISYEAR目录更名为LASTYEAR,可键入以下命令:

move c:\thisyear c:\lastyear


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. 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.


上一篇:
下一篇: