> DOS 中文参考手册 > 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 命令是从一个批脚本内执行的,改写时都发出提示。



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


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


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.