MOVE

Move files or folders.

Syntax
      MOVE [options] [Source] [Target]

Key
   Source   The path and filename of the file(s) to move.

   Target   The path to move the items to.

   options:
            /Y    Suppress confirmation prompt, when overwriting files.

            /-Y   Enable confirmation prompt, when overwriting files.

Both Source and Target can be either a folder or a file, Source but not Target can optionally include wildcards to select the files.

Under Windows 2000 and above, the default action is to prompt on overwrite unless the command is being executed from within a batch script. To force the overwriting of destination files use the COPYCMD environment variable:
SET COPYCMD=/Y

Permissions

When copying or moving a file (or folder) from a different volume, the file will inherit the permissions of the destination folder. A move is in effect a copy and then delete of the original.

When copying a file (or folder) from the same volume, the file will inherit the permissions of the destination folder.

When moving a file (or folder) from another folder on the same volume, the file will retain any directly applied permissions and will also inherit permissions from the destination folder. In this case no data is actually moved, you may notice that very large files will move instantaneously, all that has happened is that the entry in the NTFS Master File Table (MFT) has been changed.

Drive mappings do not alter this, if the files/folders are stored on the same volume, and accessed via the same file share, then a move between drive mappings will still behave as above. If you create separate file shares, then moves between those shares will behave like separate volumes.

  From the same Volume From a different Volume
COPY Destination Permissions Destination Permissions
MOVE Directly applied Source Permissions
+
Destination (Inherited permission only)
Destination Permissions

Errorlevels

If the File(s) were successfully moved/renamed %ERRORLEVEL% = 0
If the File was not found, could not be moved/renamed or bad parameters %ERRORLEVEL% = 1

Examples

Rename a file in the current folder, unlike the REN command this will replace the destination file if it already exists:

MOVE oldfile.wp newfile.doc

Move a file, specifying the full path:

MOVE g:\department\oldfile.wp "c:\Files to Convert\newfile.doc"

Using a wildcard, move only .xlsx spreadsheet files to a new folder:

MOVE "g:\department\*.xlsx" "c:\report\"

Specify the drive and filename, assumes the current folder on both drives is correct:

MOVE a:oldfile.wp c:newfile.doc

Move a file into a new folder, it is important to include the trailing backslash for the destination folder, without that, then if the destination folder does not exist, the file would be moved to a file with that name:

MOVE C:\demo\file1.txt C:\destination\

Move multiple files into a new folder, it is important to include the trailing backslash for the destination folder, without that, then if the destination folder does not exist, each file would be moved to a file with that name and each file will overwrite the previous one:

MOVE C:\demo\*.txt C:\destination\

Specify source only, will move the file to current folder, keeping the same filename:

MOVE g:\department\oldfile.wp

Quiet move, no feedback on screen:

MOVE oldfile.docx newfile.docx >nul

Move a file, but do not overwrite if the destination file already exists, this technique only works for a single file, no wildcards
( /-y is required):

Echo n|MOVE /-y c:\file1.txt c:\dir\file1.txt

MOVE is an internal command.

“Any intelligent fool can make things bigger and more complex...
It takes a touch of genius - and a lot of courage to move in the opposite direction” ~ E.F. Schumacher

Related commands

COPY - Copy one or more files to another location.
INUSE - Replace files that are in use by the OS.
ROBOCOPY /MOVE - Robust File and Folder Copy.
XCOPY - Copy files and folders.
REN - Rename a file or files.
Move the CSC folder (client-side caching).
Equivalent PowerShell: Move-Item - Move an item from one location to another (move/mv/mi).
Equivalent bash command (Linux): mv - Move or rename files or directories.


 
Copyright © 1999-2026 SS64.com
Some rights reserved