Команда move в командной строке windows

The move is an internal command found in the Windows Command Interpreter cmd that is used to move files and folders directories. The command is robust than a regular move operation as it allows for pattern matching via the inclusion of Wildcards in the source path. The command is a very

The move is an internal command found in the Windows Command Interpreter (cmd) that is used to move files and folders/directories. The command is robust than a regular move operation, as it allows for pattern matching via the inclusion of Wildcards in the source path.

The command is a very generic one and is available (in one form or the other) in almost every single operating system out there (under different aliases). In this article, we will learn about the move command and would learn various uses/applications of it.

Description of the Command :

MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2 
  • [drive:][path]filename1 –
    Specifies the location and name of the file or files you want to move.
  • destination –
    Specifies the new location of the file. The destination can consist of a drive letter and colon, a directory name, or a combination. If you are moving only one file, you can also include a filename if you want to rename the file when you move it.
  • [drive:][path]dirname1 –
    Specifies the directory you want to rename.
  • dirname2 –
    Specifies the new name of the directory.
  • /Y –
    Suppresses prompting to confirm you want to overwrite an existing destination file.
  • /Y –
    Causes prompting to confirm you want to overwrite an existing destination file.

The switch /Y may be present in the COPYCMD environment variable. This may be overridden with /-Y on the command line. The default is to prompt on overwrites unless the MOVE command is being executed from within a batch script. The above output can be obtained by executing the command move /? in cmd.

The above text is a little cryptic at first, but the command is really basic and follows the minimal blueprint.

Syntax :

MOVE [options] (Source) (Target) 

Key :

  • [option] –
    An optional flag denoted by /Y or /-Y, that is used to suppress the confirmation prompt on overwritten files. The default is to prompt on overwrites unless the MOVE command is being executed from within a batch script.
  • (Source) –
    A path of the file/files that would be used to move them. This path can contain wildcards ( * ? ) in the path. If more then files are made to move, then wildcards are used.
  • (Target) –
    A path for the new location of the file.

Using the Command :
Throughout this section, we would take the following directory as example for demonstrating the usage of move command.

Moving a File from One Folder to Another :

move source_path destination_path
  • source_path –
    It is the path of the file which we are willing to move, and the destination_path is the location to which we want the file to be moved.

Example :

  • The Dir /b command is used to list all the files and folders inside a directory.
  • In the above example, we have moved an extension-less file named salute from C:suga to C:sugaapples directory.

Moving Multiple Files from One Path to Another :

move source_path destination_path
  • source_path –
    It is a path containing wildcards that will allow more than one file to be taken as a source. The destination_path is now a path to a directory where the moved files would reside (should not contain wildcards).

Example :

  • In the above example we have moved all the files inside C:suga folder which matches the pattern *.* to C:sugaApples directory.
  • It should be noted that wildcard in source_path should match with the file(s) otherwise it would result in source_path being null, and a subsequent error.

Moving Directory from One Path to Another :

move source_dir_path Destination_dir_path
  • source_dir_path –
    It is the path to the directory to which we are moving, and destination_dir_path is the new location where it would be moved to.

Example :

  • In the above example, we have moved the C:sugaapples directory to C:UsersPublic directory.
  • Multiple Directories can be moved using the method described in Moving multiple files from one path to another (with little modification to make is eligible for directories).

Moving a File to Another Folder with a Same Name File already existing :

There are two ways to tackle this situation –

  1. Abort the move process.
  2. Continue the move process, by overwriting the existing file with the newer one.

By default, the move command upon encountering any name collisions would prompt the user, asking whether he wants to rewrite the existing file with the new one, or stop the move process (via a Y/N prompt). To abort the move process, the user can simply enter N in the prompt input, stating that the file should not be overwritten. The prompt seeking for user input (for overwrite of files) appears as follows –

Overwrite {full_file_path}? (Yes/No/All): 

When the users enter N in the prompt the output appears as follows –

Overwrite {full_file_path}? (Yes/No/All): N

0 file(s) moved.

When the user enters Y in the prompt the output appears as follows –

Overwrite {full_file_path}? (Yes/No/All): Y

1 file(s) moved.

To continue the move process by overwriting existing files (on all name collisions), a /Y switch needs to be added to the command as follows –

move /Y source_path destination_path  

From Wikipedia, the free encyclopedia

(Redirected from MOVE.EXE)

move

ReactOS-0.4.13 move command 667x434.png

The ReactOS move command

Developer(s) Microsoft, IBM, JP Software, DR, Novell, Joe Cosentino, ReactOS Contributors
Written in FreeDOS, ReactOS: C
Operating system MS-DOS, PC DOS, MSX-DOS, OS/2, eComStation, ArcaOS, Windows, DR DOS, FreeDOS, ReactOS
Platform Cross-platform
Type Command
License FreeDOS, ReactOS: GPLv2

In computing, move is a command in various command-line interpreters (shells) such as COMMAND.COM, cmd.exe,[1] 4DOS/4NT, and PowerShell. It is used to move one or more files or directories from one place to another.[2] The original file is deleted, and the new file may have the same or a different name. The command is analogous to the Unix mv command and to the OpenVOS move_file and move_dircommands.[3]

Implementations[edit]

The command is available in DOS,[4] IBM OS/2,[5] Microsoft Windows and ReactOS.[6] On MS-DOS, the command is available in versions 6 and later.[7] In Windows PowerShell, move is a predefined command alias for the Move-Item Cmdlet which basically serves the same purpose. The FreeDOS version was developed by Joe Cosentino.[8] DR DOS 6.0 includes an implementation of the move command.[9] The open-source MS-DOS emulator DOSBox has no MOVE command. Instead, the REN command can be used to move files.[10]

Syntax[edit]

To move one or more files:

MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination

To rename a directory:

MOVE [/Y | /-Y] [drive:][path]dirname1 [destination]dirname2

To move a directory:

MOVE [/Y | /-Y] [drive:][path]dirname1 destination

Parameters[edit]

  • [drive:][path]filename1: Specifies the location and name of the file or files you want to move.
  • destination: Specifies the new location of the file or directory. Destination can consist of a drive letter and colon, a directory name, or a combination, and must already exist. If you are moving only one file, you can also include a filename if you want to rename the file when you move it.
  • [drive:][path]dirname1: Specifies the directory you want to rename or move.
  • dirname2: Specifies the new name of the directory.
  • /Y: Suppresses prompting to confirm you want to overwrite an existing destination file.
  • /-Y: Causes prompting to confirm you want to overwrite an existing destination file.

The switch /Y may be present in the COPYCMD environment variable. This may be overridden with /-Y on the command line. Default is to prompt on overwrites unless MOVE command is being executed from within a batch script.

Notes[edit]

  • When moving a directory, dirname1 and its contents wind up as a subfolder beneath destination. Caution is advised — if the final subfolder of the destination path does not exist, dirname1 will be both moved and renamed.

See also[edit]

  • List of DOS commands
  • List of Unix commands

References[edit]

  1. ^ «Move». Microsoft Docs. Archived from the original on 2017-08-26. Retrieved 2017-08-26. Microsoft TechNet Move article
  2. ^ MS-DOS and Windows command line move command
  3. ^ «OpenVOS Commands Reference Manual» (PDF). StrataDOC Online Documentation Service for Stratus Products. pp. 2–552, 2–558. Archived from the original (PDF) on 2019-09-22. Retrieved October 1, 2019. move_dir: Purpose: This command moves a directory and its contents from one place to another. … move_file: Purpose: This command moves a file or set of files to another file or directory.
  4. ^ Jamsa, Kris A. (1993), DOS: The Complete Reference, Osborne McGraw-Hill, p. 206, ISBN 0078819040, archived from the original on 2018-01-25.
  5. ^ «JaTomes Help — OS/2 Commands». www.jatomes.com. Archived from the original on 2019-04-14.
  6. ^ «reactos/move.c at master». GitHub. Archived from the original on 2019-10-01.
  7. ^ Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition. Microsoft Press. ISBN 0-7356-1812-7.
  8. ^ ibiblio.org FreeDOS Package — Move (FreeDOS Base)
  9. ^ «DR DOS 6.0 User Guide Optimisation and Configuration Tips» (PDF). Archived from the original (PDF) on 2019-09-30. Retrieved 2019-08-12.
  10. ^ Commands — DOSBoxWiki

Further reading[edit]

  • Wolverton, Van (1990). MS-DOS Commands: Microsoft Quick Reference, 4th Revised edition. Microsoft Press. ISBN 978-1556152894.
  • Kathy Ivens; Brian Proffit (1993). OS/2 Inside & Out. Osborne McGraw-Hill. ISBN 978-0078818714.
  • Frisch, Æleen (2001). Windows 2000 Commands Pocket Reference. O’Reilly. ISBN 978-0-596-00148-3.

External links[edit]

  • move | Microsoft Docs

From Wikipedia, the free encyclopedia

(Redirected from MOVE.EXE)

move

ReactOS-0.4.13 move command 667x434.png

The ReactOS move command

Developer(s) Microsoft, IBM, JP Software, DR, Novell, Joe Cosentino, ReactOS Contributors
Written in FreeDOS, ReactOS: C
Operating system MS-DOS, PC DOS, MSX-DOS, OS/2, eComStation, ArcaOS, Windows, DR DOS, FreeDOS, ReactOS
Platform Cross-platform
Type Command
License FreeDOS, ReactOS: GPLv2

In computing, move is a command in various command-line interpreters (shells) such as COMMAND.COM, cmd.exe,[1] 4DOS/4NT, and PowerShell. It is used to move one or more files or directories from one place to another.[2] The original file is deleted, and the new file may have the same or a different name. The command is analogous to the Unix mv command and to the OpenVOS move_file and move_dircommands.[3]

Implementations[edit]

The command is available in DOS,[4] IBM OS/2,[5] Microsoft Windows and ReactOS.[6] On MS-DOS, the command is available in versions 6 and later.[7] In Windows PowerShell, move is a predefined command alias for the Move-Item Cmdlet which basically serves the same purpose. The FreeDOS version was developed by Joe Cosentino.[8] DR DOS 6.0 includes an implementation of the move command.[9] The open-source MS-DOS emulator DOSBox has no MOVE command. Instead, the REN command can be used to move files.[10]

Syntax[edit]

To move one or more files:

MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination

To rename a directory:

MOVE [/Y | /-Y] [drive:][path]dirname1 [destination]dirname2

To move a directory:

MOVE [/Y | /-Y] [drive:][path]dirname1 destination

Parameters[edit]

  • [drive:][path]filename1: Specifies the location and name of the file or files you want to move.
  • destination: Specifies the new location of the file or directory. Destination can consist of a drive letter and colon, a directory name, or a combination, and must already exist. If you are moving only one file, you can also include a filename if you want to rename the file when you move it.
  • [drive:][path]dirname1: Specifies the directory you want to rename or move.
  • dirname2: Specifies the new name of the directory.
  • /Y: Suppresses prompting to confirm you want to overwrite an existing destination file.
  • /-Y: Causes prompting to confirm you want to overwrite an existing destination file.

The switch /Y may be present in the COPYCMD environment variable. This may be overridden with /-Y on the command line. Default is to prompt on overwrites unless MOVE command is being executed from within a batch script.

Notes[edit]

  • When moving a directory, dirname1 and its contents wind up as a subfolder beneath destination. Caution is advised — if the final subfolder of the destination path does not exist, dirname1 will be both moved and renamed.

See also[edit]

  • List of DOS commands
  • List of Unix commands

References[edit]

  1. ^ «Move». Microsoft Docs. Archived from the original on 2017-08-26. Retrieved 2017-08-26. Microsoft TechNet Move article
  2. ^ MS-DOS and Windows command line move command
  3. ^ «OpenVOS Commands Reference Manual» (PDF). StrataDOC Online Documentation Service for Stratus Products. pp. 2–552, 2–558. Archived from the original (PDF) on 2019-09-22. Retrieved October 1, 2019. move_dir: Purpose: This command moves a directory and its contents from one place to another. … move_file: Purpose: This command moves a file or set of files to another file or directory.
  4. ^ Jamsa, Kris A. (1993), DOS: The Complete Reference, Osborne McGraw-Hill, p. 206, ISBN 0078819040, archived from the original on 2018-01-25.
  5. ^ «JaTomes Help — OS/2 Commands». www.jatomes.com. Archived from the original on 2019-04-14.
  6. ^ «reactos/move.c at master». GitHub. Archived from the original on 2019-10-01.
  7. ^ Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition. Microsoft Press. ISBN 0-7356-1812-7.
  8. ^ ibiblio.org FreeDOS Package — Move (FreeDOS Base)
  9. ^ «DR DOS 6.0 User Guide Optimisation and Configuration Tips» (PDF). Archived from the original (PDF) on 2019-09-30. Retrieved 2019-08-12.
  10. ^ Commands — DOSBoxWiki

Further reading[edit]

  • Wolverton, Van (1990). MS-DOS Commands: Microsoft Quick Reference, 4th Revised edition. Microsoft Press. ISBN 978-1556152894.
  • Kathy Ivens; Brian Proffit (1993). OS/2 Inside & Out. Osborne McGraw-Hill. ISBN 978-0078818714.
  • Frisch, Æleen (2001). Windows 2000 Commands Pocket Reference. O’Reilly. ISBN 978-0-596-00148-3.

External links[edit]

  • move | Microsoft Docs

MOVE — команда для перемещения файлов

Команда MOVE служит для перемещения одного или нескольких файлов из одного каталога в другой. А для переименования файлов используется команда RENAME.

Синтаксис и параметры команды MOVE

move [{/y|/-y}] [источник] [результат]

  • /y — Запрет на выдачу запроса подтверждения перезаписи существующего файла-результата.
  • /-y — Выдача запроса подтверждения перезаписи существующего файла-результата.
  • Командная строка команда MOVEисточник — Путь и имя одного или нескольких файлов для перемещения. Если требуется переместить или переименовать каталог, в качестве источника должен быть указан путь к текущему каталогу и его имя.
  • результат — Путь и имя, куда требуется переместить файлы. Если требуется переместить или переименовать каталог, в качестве результата должен быть указан путь к конечному каталогу и его имя.
  • /? — Отображение справки в командной строке для команды MOVE.

Примеры команды MOVE

Чтобы переместить все файлы с расширением XLS из каталога Data в каталог Second_QReports, введите: move data*.xls second_qreports

Updated: 12/30/2021 by

move command

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.

  • 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
[drive:][path]file name1 Specifies the location and name of the file or files you want to move.
destination Specifies the new location of the file. The destination can consist of a drive letter and colon, a directory name, or a combination. If you are moving only one file, you can also specify a destination file name, if you want the moved file to be renamed.
[drive:][path]dirname1 Specifies the directory you want to rename.
dirname2 Specifies the new name of the directory.
/Y Suppresses prompting to confirm you want to overwrite an existing destination file.
/-Y Causes prompting to confirm you want to overwrite an existing destination file.

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:windowstemp*.* c:temp

Move the files of c:windowstemp to the temp directory in root, this is of course assuming you have the Windowstemp 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.

Служит для перемещения одного или нескольких файлов из одного каталога в другой.

Синтаксис

move [{/y|/-y}] [источник] [результат]

Параметры

/y
Запрет на выдачу запроса подтверждения перезаписи существующего файла-результата.
/-y
Выдача запроса подтверждения перезаписи существующего файла-результата.
источник
Путь и имя одного или нескольких файлов для перемещения. Если требуется переместить или переименовать каталог, в качестве источника должен быть указан путь к текущему каталогу и его имя.
результат
Путь и имя, куда требуется переместить файлы. Если требуется переместить или переименовать каталог, в качестве результата должен быть указан путь к конечному каталогу и его имя.
/?
Отображение справки в командной строке.

Заметки

  • Использование параметра командной строки /y

    Параметр командной строки /y может быть установлен заранее в переменной среды COPYCMD. Значение может быть переопределено параметром /-y в командной строке. По умолчанию если команда copy выполняется не в пакетной программе, при замене требуется подтверждение.

  • Перемещение зашифрованных файлов

    При перемещении файлов на том, не поддерживающий шифрованную файловую систему (EFS), возникнет ошибка. Следует предварительно расшифровать файлы или переместить их на том, поддерживающий EFS.

Примеры

Чтобы переместить все файлы с расширением XLS из каталога Data в каталог Second_QReports, введите:

move data*.xls second_qreports

Понравилась статья? Поделить с друзьями:
  • Кодировка файла windows 1251 что это
  • Команда mem в командной строке windows 10 не работает
  • Кодировка консоли windows 10 по умолчанию
  • Кодировка для сайта utf 8 или windows 1251
  • Команда ls windows вывод всех файлов