Learn How to Move Folders and Subfolders Using CMD
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

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

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

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.

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.

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

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.

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.

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.

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.

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.
