Name
move
Synopsis
Move files and directories from one location to another.
Syntax
move [/y | /-y]filename[,...]destination
Description
move works like copy, except
that the source is deleted after the copy is complete.
Filename can be a single file, a group of
files (separated with commas), or a single file specification with
wildcards.
The move options are:
-
filename Specifythe location and name(s) of the file or files you want to move. Wildcards (*, ?) are supported.
-
destination Specify the new location of the file. The destination parameter can consist of a drive, a directory name, or a combination of the two. When moving one file,
destinationmay include a new name for the file.-
/y Suppress prompting to confirm creation of a directory or overwriting of the destination. This is the default when
moveis used in a batch file.-
/-y Cause prompting to confirm creation of a directory or overwriting of the destination. This is the default when
moveis used from the command line.
Examples
Move myfile.txt from the current directory to
d:\files:
C:\>move myfile.txt d:\files\Same, but rename the file to newfile.txt:
C:\>move myfile.txt d:\files\newfile.txtChange the name of the directory d:\files to
d:\myfiles:
D:\>move d:\files myfilesNotes
copy, move, and
xcopy will prompt you before overwriting an
existing file, unless you specify a command line parameter
instructing them to do otherwise. To change the default, set the
copycmd environment variable to
/y. To restore the default behavior, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access