Create and Use a Batch File to Move Multiple Files in Windows 11/10

A Batch file is a script file that helps in automating periodic tasks with the help of commands. Let us now look at the steps you need to follow to create a batch file.

How to create a Batch file on Windows 11/10

There are no restrictions in terms of the destination directory or folder to keep your Batch file in. Simply open File Explorer, visit the desired location and proceed with the steps of creating the file. You’ll now notice a new .bat file in the directory with a distinctive file icon. Let us now see how such a Batch file can be used to move one or more files from a folder from one place to another.

How to create folders using a Batch file

The Batch file you’ve just created can be used to create folders linked with this Batch file using a few simple lines of code. The good thing is that any folders you may create this way will move to the location that the original Batch file moves. Here’s what you need to do for this: Now, revisit the .bat file in its original location and double-tap on it to make the recently made changes take effect. Upon doing so, you’ll realize that Windows will create 3 folders by the names you’ve just provided. The code above can be modified to create subfolders in these new folders. E.g., you can create a subfolder ‘materials’ in FolderName2 by entering the following command: This could help you further bifurcate and better manage your files. Read: How to Run Batch Files silently in background on Windows

How to Move Multiple Files at once using a Batch file

There is a very easy process in place to move files from place to place. The only major requirement is for you to know the exact path of your destination folder to bulk transfer files. This is something you can easily seek from the folder properties by right-clicking on it. Let us now see how exactly the process of moving the files works. For this tutorial, we will be moving data from ‘FolderName1,’ which has 9 PDFs in it, to ‘FolderName2,’ which is empty. The ‘.’ here acts as a delimiter of sorts, which is used to let the program know that you want to move all the files from the source folder to the destination folder. Save this program document as a ‘.bat’ file, preferably in the same location as the original bundle of files and folders (for convenience). Now, to execute this program, double-tap on the new command’s Batch file and wait for a while. You’ll find your Windows Explorer to refresh once, after which, you can check that the files, in this case, have moved from ‘FolderName1’ to ‘FolderName2,’ as evidenced by the picture below:

As you can see, all the PDF files were moved from the original folder to a new one in one go. This code can further be modified to include and move only a select few files from a folder. You can modify it further to only include files that have a particular file extension, like ‘.png’, ‘.jpeg’, etc. Read: How to schedule a Batch File to run automatically In all the steps we followed above, we prefixed our executed codes with the keyword ‘@echo off’ which allowed you to bypass opening the command prompt for the Batch file to work, although intrinsically, a Batch file works via a command prompt only. Doing so is just time-effective and less overwhelming.

Can you move multiple files all at once into a folder?

Several keyboard shortcuts can also help you move multiple files at once. These may be time-consuming and a little boring to go through, but it saves you the hassle of going through code and executing it. For this purpose, you can use keyboard shortcuts such as; Click and Shift, holding Ctrl and going through the files, or selecting them all using Ctrl+A.

How do I automatically copy files from one folder to another in Windows 11/10?

If running a batch file to move multiple files in one go seems complicated to you, you can automate the execution of this process via the Windows Task Scheduler. In the Task Scheduler app, you can create a task, set a trigger, and under the action tab upload the script of the ‘.bat’ file to automatically copy files from one folder to the other. We hope you find this helpful.

How to Move Multiple Files at once using a Batch file - 16