How to create and use a batch file to move multiple files in Windows 10

Moving and organizing files on your computer can take time. In Windows 10, it’s faster to create a batch file (.bat) and move multiple source files and subfolders to any destination folder. You can set the properties of such a .bat file in advance and transfer files later at your ease.

A .bat file is a well known but little used secret of Windows which can execute different types of commands with exploitable results.

This is the latest 2020 guide to creating a batch file in Windows 10 from scratch. We will also show how to use 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.

Win10 Create Txt 1 batch files

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

Win10 Rename Bat 1 batch filesWin10 Rename Bat 1 batch files

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

Unusable Win10 batch files 1Unusable Win10 batch files 1

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

Win10 Visible 1 batch filesWin10 Visible 1 batch files

Use a 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. Regardless of the location of the PC to which you move the .bat file, the folders and subfolders will follow. Any content saved in these folders can be simply moved by moving the Master .bat file.

READ:   How to completely remove XBox from Windows 10

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

The goal of @echo off is to disable the display prompt. This way, you will not have to manage the command prompt, although it is internally connected to .bat file processes. If the name of your folder must contain a space, enclose it in quotes. Save the file and exit Notepad.

Win10 Folders Command 1 command filesWin10 Folders Command 1 command files

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

Batch files Win10 files created 1Batch files Win10 files created 1

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

Batch files sub-folders Win10Batch files sub-folders Win10

As noted here, the subfolders have been created.

Batch files Win10 subfolders created 1Batch 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 an appropriate folder path to complete the transfers. The best way to find out the path to a folder is to right-click and select “Properties” then “Location”.

Path to Win10 folderPath to Win10 folder

As indicated here, we will move all the content from “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 part of the folder path has a folder name with spaces, you must enclose it in quotes.

Win10 batch files A Next folder 1Win10 batch files A Next folder 1

Save the file and exit Notepad.

READ:   How to uninstall Cortana after the May 2020 update

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

Win10 batch files Moved content 1Win10 batch files Moved content 1

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

Win10 batch files Move a file 1Win10 batch files Move a file 1

If you want to move only specific file types between folders, such as JPG files, change the code as shown below.

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

Batch files File types specific to Win10 1Batch files File types specific to Win10 1

According to the code, only JPG files have been moved in this example.

Win10 Jpg batch files moved 1Win10 Jpg batch files moved 1

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

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

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


Is this article useful?

s.parentNode.insertBefore(t,s)}(window, document,’script’,
fbq(‘init’, ‘400239050508508’);
fbq(‘track’, ‘PageView’);

Leave a Reply