Command Prompt is a wonderful Windows-embedded tool to help Windows users fix computer errors, configure Windows settings, create zip folders, etc. Here, this MiniTool post will show you how to move folders and subfolders using CMD.
Command Prompt, also called CMD, is a command line interpreter utility that can exactly execute typed command lines. Do you know what kind of command lines can be used to move folders? You can keep reading and work with this tutorial to move folders and subfolders using CMD.
Way 1: Move Folders and Subfolders Using the Move Command
The move command line is used to move one or more folders from one directory to another. After running this command, the original folder will be deleted and the new one may have the same or different name. You can try this command with the following steps.
Step 1: Press Win + R to open the Run window.
Step 2: Type cmd into the text box and hit Enter to open Command Prompt.
Step 3: Type move [<source>] [<target>] and hit Enter. For example, I need to move files in the fortest folder from E: drive to D:\RecoveryDestination. Then, I need to type move E:\fortest\*.* D:\RecoveryDestination. *.* tells the computer that every file in this folder should be moved regardless of its extension.
Way 2: Move Folders and Subfolders Using the Robocopy Command
The robocopy command is powerful for copying files and directories from one location to another. You can use it to move files, mirror directories, add or remove attributes to the copied files, and more. Here I’ll introduce you to how to move multiple folders in CMD with this robocopy command.
Step 1: Type Command Prompt in the Windows Search bar.
Step 2: Right-click on the best-matched option and choose Run as administrator.
Step 3: Type robocopy <source> <destination> /move and hit Enter. Here, I’d like to move the fortest folder from E: drive to D:\RecoveryDestination; thus, the command line should be robocopy E:\fortest D:\RecoveryDestination /move.
Please note that after running this command, your file will be deleted from the original path. You can also run the robocopy /mir to mirror the directory and files to another place. However, this command will overwrite all files in the destination folder. Therefore, to run this command, you should ensure the destination folder has no important files or is an empty folder.
If your files are lost after running this command line, you should cease every operation and recover useful files with professional data recovery software, like MiniTool Power Data Recovery as files will not be sent to the Recycle Bin in this case.
MiniTool Power Data Recovery is capable of recovering lost files in various situations, including mistaken deletion, device corruption, device formatting, etc. You should recover files quickly to avoid data overwriting, leading to data being irrecoverable.
MiniTool Power Data Recovery FreeClick to Download100%Clean & Safe
Way 3: Move Folders and subfolders Using the Xcopy Command
The full name of Xcopy is Extended Copy. You can run this command to copy multiple files and entire directories to another place. Compared with the robocopy command, it is easier with fewer options. Additionally, this command line doesn’t remove the original folder after copying.
Step 1: Open the Command Prompt in the way you like.
Step 2: Type the command Xcopy <source> [<destination>] /E /H /C /I. Similarly, taking the fortest folder as an example, the command line should be Xcopy E:\fortest D:\RecoveryDestination /E /H /C /I.
/E refers to copying all subfolders, including empty folders.
/H refers to copying hidden files and system files.
/C refers to continuing the copy process notwithstanding the occurrence of errors.
/I refers to assuming a new directory if the destination is wrong or doesn’t exist.
Bottom Line
This is all about how to move folders and subfolders using CMD. You can try the above three move folder command lines following the steps. Please note that the former two command lines will remove the original folder after executing the operation. You should be careful when using these command lines.