The move command allows users to transfer files or directories from one directory to another, or from one drive to another.
Availability
Today, move is an internal command that is available in the following Microsoft operating systems. When move was first introduced with MS-DOS 6.0, it was an external command that used the move.exe file up to MS-DOS 6.22.
Availability
Move syntax
Move examples
MS-DOS 6.0 and above
Windows 95
Windows 98
Windows ME
Windows NT
Windows 2000
Windows XP
Windows Vista
Windows 7
Windows 8
Windows 10
Windows 11
Move syntax
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
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 examples
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).
- Getting ‘The syntax of the command is incorrect’ error.
move c:\example.txt h:
The command above 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.
Related information
- How to move files and folders on the computer.
- How to copy files from one drive to another drive.
- How to copy, move, or rename files with a space in the name.
- See our move definition for further information and related links on this term.