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!

Hot AI Tools

Undress AI Tool
Undress images for free

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

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

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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

In this post, you’ll learn how to translate a web page in Google Chrome on desktop or mobile, how to adjust Google translation settings, how to change Chrome language. For more Chrome tips, computer tips, useful computer tools, you can visit php.cn S

Esentutl.exe is an executable file, playing a significant role in Windows system. Some people find this component lost or not working. Other errors may emerge for it. So, how to fix the esentutl.exe error? This article on php.cn Website will develop

This tutorial teaches you how to delete TikTok account permanently from your device. You can go to your TikTok account settings to easily delete your account. After you delete the account, it will be deactivated for 30 days and be permanently deleted

TheAlienwareAG275UXMdeliversstrongcoloraccuracyandwidegamutcoveragesuitableforbothcreativeworkandgaming.1.Itoffersfactory-calibratedcoloraccuracywithΔEbelow2,oftenreachingΔE

If you can’t see the font or the graphics on your computer screen, you can zoom in on Windows 10 for a better view of the screen. Do you know how to zoom in on PC? It is not difficult. In this post, php.cn Software will show you how to zoom in on you

In your Windows Settings or you main full-screen, you may see the “your version of Windows has reached end of service” message. What does it mean? How to remove this message? This post from php.cn tells the details for you.

What is NTLite used for? How do I debloat an ISO in Windows 11? If you want to debloat Windows 11 before installing it, you can run NTLite to create your own Lite Edition. In this post, php.cn will guide you NTLite Windows 11 download and how to use

Hogwarts Legacy has caught many players’ eyes since its debut. New games will have many issues that need optimization at launch and Hogwarts Legacy is no exception. In this post on php.cn Website, we will show you how to fix Hogwarts Legacy not using
