MOVE - Move files
Purpose: Move files to a new directory and drive.
Format: MOVE [/A:[[-]rhsda] /C /D /E /F /H /M /N /P /Q /R /S /T /U
/V] source ... destination
source : A file or list of files to move.
destination : The new location for the files.
/A: (Attribute select) /P(rompt)
/C(hanged) /Q(uiet)
/D(irectory) /R(eplace)
/E (No error messages) /S(ubdirectory tree)
/F(orce delete) /T(otal)
/H(idden and system) /U(pdate)
/M(odified files) /V(erify)
/N(othing)
See also: COPY and RENAME.
File Selection
Supports extended wildcards, ranges, multiple file names, and include
lists. Date, time, or size ranges anywhere on the line apply to all
source files.
Usage
The MOVE command moves one or more files from one directory to another,
whether the directories are on the same drive or not. It has the same
effect as copying the files to a new location and then deleting the
originals. Like COPY and RENAME, MOVE works with single files, multiple
files, and sets of files specified with an include list.
The simplest MOVE command moves a single source file to a new location
and, optionally, gives it a new name. These two examples both move one
file from drive C: to the root directory on drive A:
[c:\] move myfile.dat a:\
[c:\] move myfile.dat a:\savefile.dat
In both cases, MYFILE.DAT is removed from drive C: after it has been
copied to drive A:. If a file called MYFILE.DAT in the first example, or
SAVEFILE.DAT in the second example, already existed on drive A:, it would
be overwritten. (This demonstrates the difference between MOVE and
RENAME. MOVE will move files between drives and will overwrite the
destination file if it exists; RENAME will not.)
When you move a single file, the destination can be a directory name or a
file name. If it is a directory name, and you add a backslash [\] to the
end of the name, MOVE will display an error message if the name does not
refer to an existing directory. You can use this feature to keep MOVE
from treating a mistyped destination directory name as a file name, and
attempting to move the source file to that name.
If you move multiple files, the destination must be a directory name.
MOVE will move each file into the destination directory with its
original name. If the destination is not a directory, MOVE will display
an error message and exit. For example, if C:\FINANCE\MYFILES is not a
directory, this command will display an error; otherwise, the files will
be moved to that directory:
[c:\] move *.wks *.txt c:\finance\myfiles
The /D option can be used for single or multiple file moves; it checks to
see whether the destination is a directory, and will prompt to see if you
want to create the destination directory if it doesn't exist.
If MOVE creates one or more destination directories, they will be added
automatically to the extended directory search database.
You cannot move a file to a character device like the printer, or to
itself.
Be careful when you use MOVE with the SELECT command. If you SELECT
multiple files and the destination is not a directory (for example,
because of a misspelling), MOVE will assume it is a file name. In this
case each file will be moved in turn to the destination file, overwriting
the previous file, and then the original will be erased before the next
file is moved. At the end of the command, all of the original files will
have been erased and only the last file will exist as the destination
file.
You can avoid this problem by using square brackets with SELECT instead
of parentheses (be sure that you don't allow the command line to get too
long -- watch the character count in the upper left corner while you're
selecting files). MOVE will then receive one list of files to move
instead of a series of individual filenames, and it will detect the error
and halt. You can also add a backslash [\] to the end of the destination
name to ensure that it is the name of a subdirectory (see above).
Advanced Features and Options
MOVE first attempts to rename the file(s), which is the fastest way to
move files between subdirectories on the same drive. If that fails
(e.g., because the destination is on a different drive or already
exists), MOVE will copy the file(s) and then delete the originals.
If MOVE must physically copy the files and delete the originals, rather
than renaming them (see above), then some disk space may be freed on the
source drive. The free space may be the result of moving the files to
another drive, or of overwriting a larger destination file with a smaller
source file. MOVE displays the amount of disk space recovered unless the
/Q option is used (see below). It does so by comparing the amount of
free disk space before and after the MOVE command is executed. However,
this amount may be incorrect if you are using a deletion tracking system
which retains deleted files for later recovery, or if another program
performs a file operation while the MOVE command is executed.
When physically copying files, MOVE preserves the hidden, system, and
read-only attributes of the source files, and sets the archive attribute
of the destination files. However, if the files can be renamed, and no
copying is required, then the file attributes are not changed.
Use caution with the /A: and /H switches (both of which can allow MOVE to
process hidden files) when you are physically moving files, and both the
source and destination directories contain file descriptions. If the
source file specification matches the description file name (normally
DESCRIPT.ION), and you tell MOVE to process hidden files, the
DESCRIPT.ION file itself will be moved, overwriting any existing file
descriptions in the destination directory. For example, if the C:\DATA
directory contains file descriptions, this command would overwrite any
existing descriptions in the D:\SAVE directory:
[c:\data] move /h d*.* d:\save\
(If you remove the hidden attribute from the DESCRIPT.ION file the same
caution applies even if you do not use /A: or /H, as DESCRIPT.ION is then
treated like any other file.)
If you move a file from a FAT volume to an HPFS volume, and you do not
give an explicit destination name (i.e. you are moving the file to the
current directory, or your destination name is made up entirely of
wildcards), MOVE will look for a .LONGNAME extended attribute for the
source file. If it finds that attribute, it will use the long filename
for the destination file. If it does not, it will use the short name.
Similarly, if you MOVE files with long filenames from an HPFS volume to a
FAT volume, CMD.EXE will create the destination files with short,
FAT-compatible names and save the long filenames in the .LONGNAME
extended attribute. The short name is created by replacing special
characters with underscores, adding numeric digits to the filename (if
necessary) to make the new name unique, and truncating the name to fit
with in the "8.3" FAT name structure.
Options
/A:: (Attribute select) Select only those files that have the
specified attribute(s) set. Preceding the attribute character
with a hyphen [-] will select files that do not have that
attribute set. The colon [:] after /A is required. The
attributes are:
R Read-only
H Hidden
S System
D Subdirectory
A Archive
If no attributes are listed at all (e.g., MOVE /A: ...), MOVE will select
all files and subdirectories including hidden and system files. If
attributes are combined, all the specified attributes must match for a
file to be selected. For example, /A:RHS will select only those files
with all three attributes set.
See the cautionary note under Advanced Features and Options above before
using /A: when both source and destination directories contain file
descriptions. /C:(Changed files) Move files only if the destination file
exists and is older than the source (see also /U). This option is useful
for updating the files in one directory from those in another without
moving any newly-created files. /D:(Directory) Requires that the
destination be a directory. If the destination does not exist, MOVE will
prompt to see if you want to create it. If the destination exists as a
file, MOVE will fail with an "Access denied" error. Use this option to
avoid having MOVE accidentally interpret your destination name as a file
name when it's really a mistyped directory name. /E:(No error messages)
Suppress all non-fatal error messages, such as "File Not Found." Fatal
error messages, such as "Drive not ready," will still be displayed. This
option is most useful in batch files and aliases. /F:(Force delete) This
option forces deletion of the source file without saving it to the DELDIR
directory (if DELDIR is not in use, /F has no effect). /F is only
effective when MOVE must copy the source file(s) and delete the originals
(i.e., if the destination is on a different drive or the destination file
already exists). If the files are simply renamed, /F has no effect.
/H:(Hidden) Move all files, including hidden and system files. See the
cautionary note under Advanced Features and Options above before using /H
when both source and destination directories contain file descriptions.
/M:(Modified files) Move only files that have the archive bit set. The
archive bit will remain set after the MOVE; to clear it use ATTRIB.
/N:(Nothing) Do everything except actually move the file(s). This option
is most useful for testing what a complex MOVE command will do.
/P:(Prompt) Prompt the user to confirm each move. Your options at the
prompt are explained in detail under Page and File Prompts. /Q:(Quiet)
Don't display filenames, the total number of files moved, or the amount
of disk space recovered, if any. This option is most often used in batch
files. See also /T. /R:(Replace) Prompt for a Y or N response before
overwriting an existing destination file. /S:(Subdirectories) Move an
entire subdirectory tree to another location. MOVE will attempt to
create the destination directories if they don't exist, and will remove
empty subdirectories after the move. When /D is used with /S, you will
be prompted if the first destination directory does not exist, but
subdirectories below that will be created automatically by MOVE. If MOVE
/S creates one or more destination directories, they will be added
automatically to the extended directory search database.
If you attempt to use /S to move a subdirectory tree into part of itself,
MOVE will detect the resulting infinite loop, display an error message,
and exit. /T:(Total) Don't display filenames as they are moved, but
display the total number of files moved and the amount of free disk space
recovered, if any. /U:(Update) Move each source file only if it is newer
than a matching destination file or if a matching destination file does
not exist (also see /C). This option is useful for moving new or changed
files from one directory to another. /V:(Verify) Verify each disk write.
This is the same as executing the VERIFY ON command, but is only active
during the MOVE. /V does not read back the file and compare its contents
with what was written; it only verifies that the data written to disk is
physically readable.
Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs