The PowerShell move files from one folder to another using the Move-Item cmdlet. Let us see some PowerShell commands to perform various operations to move files from one folder to another, one registry to another, and one directory to another.
Windows PowerShell is way more efficient and useful than the command prompt on Windows. But only a few know how to use it as it offers better and more efficient ways to move files from one folder to another on your computer. Let us learn how PowerShell move files from one folder to another from this article offered by EaseUS and some basic commands for various requirements.
PowerShell is a command line shell for cross-platform task automation. Along with command lines, it comprises scripting languages and configuration management, making it more useful and efficient than the command prompt. File Management is essential to remove redundancy and segregate and organize files. Since the manual process can be tedious, we will use PowerShell to do the work for us.
Yes, PowerShell can copy all files from one folder to another. PowerShell has a command called Move-Item cmdlet, which lets you transfer items, files, and folders on your PC from one place to another, along with the contents, properties, and child items. But, the same provider should support both locations (the target and the source).
Moving a file is pretty easy, but while doing the same with folders, registries, and directories, we cannot do it manually for every file. With the move-item command, we can move files or subdirectories between directories, registry keys, and subkeys from one location to another or move an entire folder to another.
If you want to know how to use Xcopy Command to copy folder and subfolder, read the following article.
Copy Folders and Subfolders Using Xcopy Command
In this post, you can learn what Xcopy is and how to copy folders and subfolders using the Xcopy command in various cases.
If you are new to using PowerShell, this seems confusing. Take a look at the examples below to understand how the commands for PowerShell move files from one folder to another.
If you want to move a single file from one directory to another directory while renaming it, you can follow the below command.
With this command, you are transferring the directory1.txt file from the C drive to the Target directory of the E drive while renaming the file to directory2.txt from directory1.txt.
The following commands let you transfer the contents of the entire directory, along with the subdirectories and files, to another directory.
Upon execution, the command will move all the contents of the Source directory to the Target directory, including everything.
Let's say you want to move all files of the MP3 extension from one directory to another; you can use this command.
So, all of the mp3 files (indicated by *) in the current directory (indicated by .) will be moved to the Music directory.
Now, what if you have more MP3 files in the subdirectories? The above case may not help you. So, you have to recursively move the MP3 files in every subdirectory and move them to the destination using the Child-Item cmdlet.
This command will run recursively to move all the mp3 files in the current directory and its subdirectories to the MusicFiles directory.
See how to move registry keys and values within the registry to another one.
Here, the registry and key values of the MyCompany registry key located in HKLM\Software are moved to the MyNewCompany key. The (*) after the "mycompany" indicates that all the content of the MyCompnay key will be transferred, except for the key.
Learn the command to move and copy the directory and its contents to another subdirectory of a specified directory.
This command will move the Music[Jan`10] directory and all its contents into the Music[2010] directory.
Is this article helpful? If so, share it on your social media to help more people.
PowerShell is a great addition to your OS for various tasks but comes with the risk of losing or corrupting files when there are mistakes while executing a command. So, a better way is to automatically back up your files rather than moving from one place to another. This way, you can move the files while also safeguarding them from accidental deletion.
EaseUS Todo Backup is an auto and free backup tool with advanced backup algorithms to create a copy of your files safely. You can schedule the backup weekly or daily to automate the process to sit back and relax. It can back up your Windows to a USB drive and perform different backup types, like full, incremental and differential backups. The following are some highlights of this backup tool:
The tool can do it all, be it files, folders, or the entire system. Additionally, you can make images and clones and store the files on the cloud to keep them safe. Download the tool, and make a backup of your files now.
Step 1. To initiate a backup, click the Select backup contents option.
Step 2. There are four data backup categories, File, Disk, OS, and Mail, click File.
Step 3. On the left, both local and network files will be shown. You may extend the directory to pick the backup files.
Step 4. Follow the on-screen instructions and choose a location to store the backup.
Click Options to encrypt the backup with a password in Backup Options, then click Backup Scheme to specify the backup schedule and start the backup at a certain event. There are also other additional choices you may choose to tailor the backup process to your requirements.
Step 5. The backup may be stored on a local disk, EaseUS' online service, or NAS.
Step 6. EaseUS Todo Backup enables customers to back up data to a third-party cloud drive as well as its own cloud drive.
If you want to back up data to a cloud drive provided by a third party, choose Local Drive, scroll down to add Cloud Device, and then add and log in to your account.
You can also choose the EaseUS cloud drive. Sign up for an EaseUS Account, then click EaseUS Cloud and log in.
Step 7. Click Backup Now to begin the backup process. The backup job will be presented as a card on the left side of the panel after it has been finished. Right-click the backup job to handle it further.
The command line tools are confusing initially, but once you get used to them, you can have a ball. We have listed six scenarios of using PowerShell move files from one folder to another. Ensure you copy the commands exactly to avoid losing or corrupting files on your system. The best way to avoid accidents and keep your files is to automatically back them up using a professional backup tool like EaseUS Todo Backup. Along with a folder, you can also backup hard drives, make clones, and create system images with award-winning algorithms.
Here are some of the most frequently asked questions on PowerShell moving files from one folder to another. If you have similar queries, I hope this will help you.
1. Is there a script that will move files from one folder to another?
Yes, scheduling a batch script will automatically move files from one folder to another. You need to create a task to move the files from one folder to another and put it into an automated task.
2. How do you move multiple files to one folder?
Open the source folder, left-click on the first item, left-click on the last item while holding the Shift button to select all the files in the folder, and click on Cut. Now, go to the destination folder and paste the files.
3. How do you move files without copying Windows 10?
Instead of copying, you can Cut the files and paste them into the destination folder. The Keyboard shortcuts for this method are Ctrl + X to Cut and Ctrl + V to Paste.
Related Articles
System Image Recovery vs. System Restore in Windows 11/10/8/7
An Ultimate Guide: How to Use Backup and Restore in Windows 7/10
How to Update HP BIOS on Windows 11/10/8/7
(1+1>2 Solution) How to Use/Set up SSD as Boot Drive and HDD Storage