my-server
← Wiki

Move (command)

<code>move</code> is a shell command for renaming and moving files and directories.

The command is in various shells including COMMAND.COM, Command Prompt, 4DOS/4NT. In PowerShell, is a predefined command alias for the <code>Move-Item</code> Cmdlet which serves the same essential purpose.

The command is available in various operating systems including DOS, OS/2, Windows and ReactOS. On MS-DOS, the command is available in versions 6 and later. The FreeDOS version was developed by Joe Cosentino. DR DOS 6.0 includes an implementation of the command. The open-source MS-DOS emulator DOSBox has no <code>MOVE</code> command. Instead, the <code>REN</code> command can be used to move files.

The command is analogous to the Unix-based <code>mv</code> command and to the OpenVOS <code>move_file</code> and <code>move_dir</code>commands.

Options

  • <code>/y</code> Suppress prompting to confirm overwriting an existing destination file
  • <code>/-y</code> Prompt to confirm overwriting an existing destination file

By default, the command prompts to overwrite unless executed in a batch script. The default can be modified by including the <code>/y</code> option in the <code>COPYCMD</code> environment variable. Then, that can be overridden via the <code>/-y</code> command-line option.

Examples

The following command renames a file or directory to if is not an existing directory. If it is an existing directory, then is moved into and is then at path .

> move foo bar

See also

References

Further reading

External links