Move - DOS/Command Prompt Reference
Moves files. Or renames the directory name.
Syntax
move [/Y | /-Y] <source>[,<source2>...] <destination>
Options
<source> | Specifies the source file/directory name to move or rename (directory only). You can use wildcards to specify multiple files/directories. |
,<source2>... |
[MS-DOS, Windows 95/98/Me only] You can specify multiple files/directories by separating with ‘,’. Note that spaces cannot be included before and after ‘,’. [Windows NT series] You cannot specify multiples with ‘,’. |
<destination> |
Specifies the destination file/directory name for move, or specifies the directory name after rename. If a single file or directory is specified as a source, its name is renamed to <destination>. If multiple files or directories are specified as sources, you can only specify a directory name to <destination>. [MS-DOS, Windows 95/98/Me only] When the destination directory does not exist, Move prompts to create the directory. [Windows NT series] If <source> does not refer to the directory, and the directory <destination> does not exist, an error occurs. |
/Y |
Suppresses prompting to confirm whether to overwrite the destination file(s) even if it exists. [MS-DOS, Windows 95/98/Me only] If the destination directory does not exist, Move creates the directory automatically without prompting to confirm. |
/-Y | Prompts to confirm whether to overwrite the destination file(s) if it exists (even if ‘/Y’ is specified to the environment variable COPYCMD). |
Details
This command moves files and directories. To copy instead of move, use Copy command.
When multiple files or directories (including using wildcards) are specified as move source, you must specify a directory name as the move destination. If you specify a file name as the destination, an error occurs.
[MS-DOS only] When renaming a directory name, the destination directory name must belong to the same parent directory for the source directory.
Samples
Sample 1
move *.log C:\Logs\Current
Moves files with the extensions ‘.log’ in the current directory to the directory C:\Logs\Current.
Sample 2
move /Y MyFile.txt,MyData.xls D:\Keep
[MS-DOS, Windows 95/98/Me only] Move the file MyFile.txt and MyData.xls to the directory D:\Keep. If D:\Keep exists and MyFile.txt and MyData.xls already exist, the files will be overwritten. If D:\Keep does not exist, it will be created.
Sample 3
move C:\Logs\Current C:\Logs\2007
Renames the directory C:\Logs\Current to C:\Logs\2007.