Home » How to Move a Directory in CMD

How to Move a Directory in CMD

You can use the following syntax in Command Prompt (CMD) to move a directory and its contents:

move source_directory destination_directory

This example will move the specified directory and all its contents to the new location.

Note: Ensure that the destination directory path you provide does not already exist, otherwise you will receive an error.

The following example shows how to use this syntax in practice.

Example: Moving a Directory in CMD

Suppose that we want to move a directory named source_folder to destination_folder in the following path:

C:\Users\admin\Documents\cmd_script

We can type the following command to move the directory:

move C:\Users\admin\Documents\cmd_script\source_folder C:\Users\admin\Documents\cmd_script\destination_folder

The following screenshot shows how to use this syntax in practice:

Move directory in cmd
Move the directory in cmd

We can see that the directory source_folder and all its contents have been moved to the destination_folder in C:\Users\admin\Documents\cmd_script.

Conclusion

We can use the move command followed by the path to move any directory and its contents on the system.

You can find more topics about Active Directory tools and PowerShell basics on the ActiveDirectoryTools home page.