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.
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.
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
.
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
.
/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!

Is ExpressVPN not connecting on iPhone, Android phone, Mac, or Windows PC? What should you do if ExpressVPN won’t connect or work? Take it easy and go to find solutions from this post. Here, php.cn collects multiple ways to solve this internet issue.

Is 100% GPU usage bad? How to fix 100% GPU usage in Windows 10? Don’t fret. php.cn Website provides you with this article to work out high GPU issues. Those methods are worth a try if you are undergoing 100% GPU usage.

You can use add-ins in Microsoft Word to get more features. This post introduces how to download, install, add or remove add-ins in Microsoft Word. A free file recovery method is also provided to help you recover deleted/lost Word or any other files.

Some people find the system backup error codes 0x807800A1 & 0X800423F3 when they attempt to create a system backup. These codes will prevent you from doing any backup tasks. Don’t worry! This article on php.cn Website will teach you how to fix th

Want to get an ISO file of Windows 10 Enterprise to install it for business usage? Windows 10 Enterprise ISO download & install are easy and php.cn will show you how to download Windows 10 Enterprise ISO 20H2, 21H1, or 21H2 via some direct downlo

NordVPN not connecting or working on your Windows 11 computer? Do you know the reasons for this issue? If you want to solve this problem, do you know what you should do? If you have no idea, you come to the right place. In this post, php.cn Software

Nowadays, Twitter becomes more and more popular all over the world. However, sometimes you may find it is not working properly. Is Twitter down? How to check it? How to fix it? This post from php.cn provides details for you.

When does Redfall come to market? Redfall fans can’t wait to try this game. fortunately, the release date has been clarified and more information we know about Redfall will be all disclosed in this article on php.cn Website, so if you are interested,


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
