Move Folders and Subfolders Using CMD: Three Commands (2024)

  • Home
  • News
  • Full Guide to Move Folders and Subfolders Using CMD

By Andrea | Follow |Last Updated

English

  • Deutsch

Command Prompt is a wonderful Windows-embedded tool to help Windows users fix computer errors, configure Windows settings, create zip folders, etc. Here, thisMiniToolpost 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.

Three Ways to Move Files from Subfolders to the Main FolderHow to move files from subfolders to the main folder? It is a piece of cake when you work with this tutorial.Read More

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: PressWin + Rto open the Run window.

Step 2: Typecmdinto the text box and hitEnterto open Command Prompt.

Step 3: Typemove [<source>] [<target>]and hitEnter. For example, I need to move files in the fortest folder from E: drive to D:\RecoveryDestination. Then, I need to typemove E:\fortest\*.* D:\RecoveryDestination.*.*tells the computer that every file in this folder should be moved regardless of its extension.

Move Folders and Subfolders Using CMD: Three Commands (2)

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: TypeCommand Promptin the Windows Search bar.

Step 2: Right-click on the best-matched option and chooseRun as administrator.

Step 3: Typerobocopy <source> <destination> /moveand hitEnter. Here, I’d like to move the fortest folder from E: drive to D:\RecoveryDestination; thus, the command line should berobocopy E:\fortest D:\RecoveryDestination /move.

Move Folders and Subfolders Using CMD: Three Commands (3)

Please note that after running this command, your file will be deleted from the original path. You can also run therobocopy /mirto 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 professionaldata 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 shouldrecover filesquickly to avoid data overwriting, leading to data being irrecoverable.

Recover Files Deleted by Robocopy /Mir: Two Practical MethodsDo you know how to recover files deleted by robocopy /mir? This post puts forward 2 methods to get them back.Read More

Way 3: Move Folders and subfolders Using the Xcopy Command

The full name ofXcopyis 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 commandXcopy <source> [<destination>] /E /H /C /I. Similarly, taking the fortest folder as an example, the command line should beXcopy E:\fortest D:\RecoveryDestination /E /H /C /I.

Move Folders and Subfolders Using CMD: Three Commands (5)

/Erefers to copying all subfolders, including empty folders.

/Hrefers to copying hidden files and system files.

/Crefers to continuing the copy process notwithstanding the occurrence of errors.

/Irefers to assuming a new directory if the destination is wrong or doesn’t exist.

Robocopy vs Xcopy: What Are the Differences Between Them?Both Xcopy and Robocopy are very useful when you need to transfer files. This article will provide you with detailed information about Xcopy vs Robocopy.Read More

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.

About The Author

Andrea Follow Us

Position: Columnist

Andrea graduated in English and has a keen interest in the IT industry and questions that arise when computers are used. She is passionate about new things and challenging things and has a wide range of interests like playing guitar, gaming, and crafting.

Move Folders and Subfolders Using CMD: Three Commands (2024)

FAQs

Move Folders and Subfolders Using CMD: Three Commands? ›

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.

How to move files using cmd? ›

Use the mv command to move files and directories from one directory to another or to rename a file or directory. If you move a file or directory to a new directory without specifying a new name, it retains its original name. Attention: The mv command can overwrite many existing files unless you specify the -i flag.

What is the command to move a folder to another location? ›

The mv command moves files and directories from one directory to another, or renames a file or directory. If you move a file or directory to a new directory, it retains the base file name. When you move a file, all links to other files remain intact, except when you move it to a different file system.

How do I access subfolders in cmd? ›

From a CMD prompt, you can run DIR /S, or TREE to display the folders and subfolders. From a PowerShell prompt you can run Get-ChildItem -Recurse to do essentially the same thing.

How to move folders using terminal? ›

In the Terminal app on your Mac, use the mv command to move files or folders from one location to another on the same computer. The mv command moves the file or folder from its old location and puts it in the new location.

How to move multiple files with CMD? ›

Here are the steps:
  1. Open the command prompt by pressing the Windows key + R, then type "cmd" and press Enter.
  2. Navigate to the folder that contains the files you want to move. ...
  3. Use the command "move /y" followed by the path of the source folder and the destination folder.
Jul 1, 2023

How do I move a folder back in Command Prompt? ›

Type. cd.. into the prompt. After you press Enter, this command tells the program to navigate back to the previous folder. It's important you type the two dots, since you won't navigate anywhere if you simply type “cd” into the prompt.

How to change folders in cmd? ›

Type cmd into the Windows 11 or Windows 10 search bar to open the command prompt. Type cd followed by a space, and then drag the folder or type the name of the folder into the command prompt. Check that your syntax is correct if directory changes don't work.

How do I show all folders and subfolders? ›

Open File Explorer.

Click on the View tab, then click on Navigation pane. Click on Show all folders.

How to copy folder and subfolders using cmd? ›

The common syntax to copy folders and subfolders with CMD is xcopy [source] [destination] [options]. We can use various options of the above command depending on our demands. Below are some of the cases we often perform using the Xcopy command.

How to move folders with cmd? ›

Way 1: Move Folders and Subfolders Using the Move Command
  1. Step 1: Press Win + R to open the Run window.
  2. Step 2: Type cmd into the text box and hit Enter to open Command Prompt.
  3. Step 3: Type move [<source>] [<target>] and hit Enter. ...
  4. Step 1: Type Command Prompt in the Windows Search bar.
Apr 16, 2024

Which command will move you up one folder? ›

cd.. - This command will move you up one directory from your current location. For example: If you are currently at C:\Users\ username \ and you enter you will be taken to C:\Users\

How to enter a folder in cmd? ›

Type "cd" followed by a space, but do not press Enter just yet. Type the address of the folder after the space and press ↵ Enter . You'll need to include every folder and sub-folder the folder is located in. Place a backslash ("\") in front of each folder name.

How to take ownership of a folder and subfolders in Windows cmd? ›

Step 1: Press Windows + R to invoke Run window. Step 2: Input cmd and press Ctrl + Shift + Enter to run your Command Prompt as administrator. Step 3: Type the command lines takeown /F Path (Path should be replaced by the actual path of the problematic file) and press Enter key to take ownership of the file.

How do I change a directory to a subfolder in cmd? ›

Moving Between Folders
  1. cd folder name – to move to a sub-folder of the current folder e.g. cd documents.
  2. cd .. – moves to the folder above the current folder.
  3. cd \ – jumps to the top level of the current drive.

How do I move all files and folders in mv command? ›

Simply use mv folder1/folder2/* <destination> . This command will move all files in folder1/folder2 to your specified destination.

How do I move one folder back in Command Prompt? ›

Type. cd.. into the prompt. After you press Enter, this command tells the program to navigate back to the previous folder. It's important you type the two dots, since you won't navigate anywhere if you simply type “cd” into the prompt.

Top Articles
Latest Posts
Article information

Author: Msgr. Refugio Daniel

Last Updated:

Views: 5730

Rating: 4.3 / 5 (74 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Msgr. Refugio Daniel

Birthday: 1999-09-15

Address: 8416 Beatty Center, Derekfort, VA 72092-0500

Phone: +6838967160603

Job: Mining Executive

Hobby: Woodworking, Knitting, Fishing, Coffee roasting, Kayaking, Horseback riding, Kite flying

Introduction: My name is Msgr. Refugio Daniel, I am a fine, precious, encouraging, calm, glamorous, vivacious, friendly person who loves writing and wants to share my knowledge and understanding with you.