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

Featured Image Create Batch Files Windows 10

Moving and arranging files around on your computer can be time-consuming. In Windows 10, it is faster to create a batch file (.bat) and move multiple source files and subfolders to any destination folder. You can define the properties of such a .bat file in advance and transfer files later at your ease.

A .bat file is a well-known yet little used secret of Windows which can execute different kinds of commands with actionable results.

This is the latest 2020 guide for creating a batch file in Windows 10 from scratch. We will also show how to utilize such a .bat file to move files from any source to a destination folder.

Create a Batch File from Scratch

You can create a .bat file in any Windows 10 folder of your choice. To create it from scratch, simply go to the destination folder of your choice, right-click and create a new .txt file.

Batch Files Win10 Create Txt 1

Once the Notepad file is created, rename the extension from .txt to .bat.

Batch Files Win10 Rename Bat 1

Ignore the “file will become unusable” message due to change in file name extension and click Yes. An empty batch file has now been created with no contents.

Batch Files Win10 File Unusable 1

The .bat file is prominently visible in the folder. It can be deleted, copy-pasted, renamed, and transferred to any other folder.

Batch Files Win10 Visible 1

Use Batch File to Create Folders and Subfolders

You can use a .bat file to create separate folders and subfolders whose contents and properties remain connected to the .bat file. No matter which PC location you move the .bat file to, the folders and subfolders will follow. Any contents saved in these folders can simply be moved by relocating the Master .bat file.

Right-click the created .bat file to “Edit using Notepad” and enter the following to create folders using folder names.

The purpose of @echo off is to disable the display prompt. This way you won’t have to deal with the Command prompt, although it’s internally connected to .bat file processes. If your folder name should contain a space, put it inside quotes. Save the file and exit Notepad.

Batch Files Win10 Folders Command 1

As soon as you click the .bat file, it will execute the command to create the new folders.

Batch Files Win10 Folders Created 1

To create subfolders in any folder, modify the above code as shown here. Save the file and exit Notepad.

Batch Files Win10 Subfolders

As shown here, the subfolders have been created.

Batch Files Win10 Subfolders Created 1

Move Files from One Folder to Another Using Batch Files

You can use .bat files to move files from any folder on your Windows 10 to a destination folder of your choice. All you need is a proper folder path to complete the transfers. The best way to know a folder’s path is to right-click and select “Properties” followed by “Location.”

Batch Files Win10 Folder Path

As shown here, we will move all the contents of “FolderA” to “FolderB.” The command is as follows:

Here, *.* is a wildcard that tells Windows 10 to copy all the files in the source folder. If any part of the folder path has a folder name with spaces, you need to enclose it within quotes.

Batch Files Win10 One Folder Next 1

Save the file and exit Notepad.

The entire contents of one folder have been moved to another by clicking .bat file.

Batch Files Win10 Contents Moved 1

If you want to move only select files, the code can be slightly modified as shown below.

Batch Files Win10 Move One File 1

If you wish to move only specific file types between the folders, for example, JPG files, modify the code as shown below.

For example, to move all .jpg files, use the code below:

Batch Files Win10 Specific Filetypes 1

As per the code, only JPG files have moved in this example.

Batch Files Win10 Jpg Moved 1

You can replace the .jpg with .pdf, .png, or any other file type you want to move.

In this guide you have learned how to create a batch file from scratch and move files and folders around your computer. Every time you click on a .bat file, it will move the contents at the target location. It’s so simple!

Do you also know that you can batch edit images abd batch rename files in Windows? Click the links to find out how

Related:

Sayak Boral Sayak Boral

Sayak Boral is a technology writer with over ten years of experience working in different industries including semiconductors, IoT, enterprise IT, telecommunications OSS/BSS, and network security. He has been writing for MakeTechEasier on a wide range of technical topics including Windows, Android, Internet, Hardware Guides, Browsers, Software Tools, and Product Reviews.

Leave a Comment

Yeah! You've decided to leave a comment. That's fantastic! Check out our comment policy here. Let's have a personal and meaningful conversation.