Home Computer Tutorials Computer Knowledge Learn How to Move Folders and Subfolders Using CMD

Learn How to Move Folders and Subfolders Using CMD

Apr 16, 2025 am 12:13 AM

Move folders and subfolders using CMD command

Command Prompt (CMD) is a powerful tool that comes with Windows systems, which can help users fix computer errors, configure Windows settings, create compressed folders, and so on. This article will show you how to move folders and subfolders using CMD commands.

Learn How to Move Folders and Subfolders Using CMD

Command Prompt, also known as CMD, is a command line interpreter utility that executes the typed command line accurately. So, what command lines can be used to move folders? Please continue reading this tutorial to learn how to move folders and subfolders using CMD.

Method 1: Use the move command to move folders and subfolders

The move command 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 folder can have the same or different name. You can try this command as follows:

Step 1: Press Win R to open the run window.

Step 2: Type cmd in the text box and press Enter to open the command prompt.

Step 3: Type move [源文件夹] [目标文件夹] and press Enter . For example, you need to move the file in the E disk fortest folder to D:\RecoveryDestination. You need to type move E:\\fortest\\*.* D:\\RecoveryDestination . *.* means moving all files in this folder regardless of their extension.

Learn How to Move Folders and Subfolders Using CMD

Method 2: Use robocopy command to move folders and subfolders

The robocopy command is powerful and can copy files and directories from one location to another. You can use it to move files, mirror directories, add or delete properties to copied files, and more. Here is how to use the robocopy command to move multiple folders in CMD.

Step 1: Type "Command Prompt" in the Windows search bar.

Step 2: Right-click the most matching option and select Run as administrator.

Step 3: Type robocopy [源文件夹] [目标文件夹] /move and press Enter . For example, to move the E disk fortest folder to D:\RecoveryDestination, the command line should be robocopy E:\\fortest D:\\RecoveryDestination /move .

Learn How to Move Folders and Subfolders Using CMD

Note that after running this command, the file will be deleted from the original path. You can also run robocopy /mir to mirror directories and files to another location. However, this command will overwrite all files in the target folder. Therefore, before running this command, make sure there are no important files or empty folders in the target folder.

If the file is lost after running this command line, stop all operations immediately and use professional data recovery software such as MiniTool Power Data Recovery to recover useful files, as the files will not be sent to the Recycle Bin in this case. MiniTool Power Data Recovery can recover lost files under various circumstances, including error deletion, device corruption, device formatting, etc. Files should be recovered quickly to avoid overwriting of data, which will cause data to be recovered.

Method 3: Use xcopy command to move folders and subfolders

The full name of xcopy is Extended Copy. You can run this command to copy multiple files and the entire directory to another location. It is simpler with fewer options than the robocopy command. Additionally, this command line does not delete the original folder after copying.

Step 1: Open the command prompt the way you like.

Step 2: Type the command xcopy [源文件夹] [目标文件夹] /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 .

Learn How to Move Folders and Subfolders Using CMD

/E refers to copying all subfolders, including empty folders.

/H refers to copying hidden files and system files.

/C refers to the continued copying process even if an error occurs.

/I refers to the assumed new directory if the target path is wrong or does not exist.

Summarize

That's all about how to move folders and subfolders using CMD. You can follow the above steps to try the above three moving folder command lines. Note that the first two command lines will delete the original folder after performing the operation. Care should be taken when using these command lines.

The above is the detailed content of Learn How to Move Folders and Subfolders Using CMD. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to Fix the Steam Cloud Error? Try These Methods How to Fix the Steam Cloud Error? Try These Methods Apr 04, 2025 am 01:51 AM

The Steam Cloud error can be caused by many reasons. To play a game smoothly, you need to take some measures to remove this error before you launch the game. php.cn Software introduces some best ways as well as more useful information in this post.

Remove PC App Store Malware - A Full Guide for You! Remove PC App Store Malware - A Full Guide for You! Apr 04, 2025 am 01:41 AM

If you have a program called PC App Store on your computer and did not purposely install it, then your PC may be infected with the malware. This post from php.cn introduces how to remove PC App Store malware.

HackTool:Win64/ExplorerPatcher!MTB - How to Remove? HackTool:Win64/ExplorerPatcher!MTB - How to Remove? Apr 04, 2025 am 01:23 AM

ExplorerPatcher is an Open-Source portable executable that lets you customise the Windows 11 Start Menu, Taskbar, File Explorer, and more. However, many users receive this Trojan warning about HackTool:Win64/ExplorerPatcher!MTB. Why does that happen

Is Core Isolation Blocked by ew_usbccgpfilter.sys? Here Are Fixes! Is Core Isolation Blocked by ew_usbccgpfilter.sys? Here Are Fixes! Apr 13, 2025 am 12:47 AM

Many SurfaceBook users report that they meet the “core isolation blocked by ew_usbccgpfilter.sys” issue on Windows 11/10. This post from php.cn helps to fix the annoying issue. Keep on your reading.

Effortles Fixes for Black Screen After Installing a Graphics Driver Effortles Fixes for Black Screen After Installing a Graphics Driver Apr 15, 2025 am 12:11 AM

Have you ever encountered a black screen after installing a graphics driver like an Nvidia driver in Windows 10/11? Now in this post from php.cn, you can find a couple of worth trying solutions to the Nvidia driver update black screen.

Fixdisk Windows 7: Check Your Hard Disk for Errors on Windows 7 Fixdisk Windows 7: Check Your Hard Disk for Errors on Windows 7 Apr 14, 2025 am 12:40 AM

If you suspect your hard drive encounters issues, you can check the drive for errors on Windows 7. This php.cn post talks about fixdisk Windows 7. You can follow the guide to check the hard drive for errors on Windows 7.

How to Install Windows X-Lite Optimum 11 23H2 Home/Pro via ISO How to Install Windows X-Lite Optimum 11 23H2 Home/Pro via ISO Apr 09, 2025 am 12:49 AM

Windows X-Lite Optimum 11 23H2 Home or Optimum 11 Pro could be your option if you need a custom lite system based on Windows 11 23H2. Go on reading and php.cn will show you how to download Optimum 11 23H2 ISO and install Pro or Home on your PC.

Advanced Tips for Windows   P Not Working on Windows Advanced Tips for Windows P Not Working on Windows Apr 11, 2025 am 12:49 AM

You must be familiar with the Windows P shortcut if you have more than one monitor. However, the Windows P not working properly might happen occasionally. If you are facing this problem, this post from php.cn can help you indeed.

See all articles