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

Speed up file transfer on your PC by using a batch file to move multiple files in one go.

Batch File Move Files Featured Image

Moving and arranging files on your computer can be time-consuming. In Windows, 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 leisure.

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

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

What Do Batch Files Do in Windows?

A batch file in Windows is an automated script file that helps perform routine tasks using predefined commands without any further user action. With a batch file, you can set it to run automatically at a predefined hour in the background.

Create a Batch File from Scratch

You can create a .bat file in any Windows folder of your choice. To create it from scratch, simply go to the destination folder of your choice.

  1. Right-click to create a new .txt file that can be opened in Notepad. In Windows 11, you can also create a new .txt file via the context menu at the top of the file explorer window.
Batch Files Windows11 New Text Document
  1. Once the Notepad file is created, rename the extension from .txt to .bat.
Batch Files Windows11 Renaming Text Document Bat Extension 1
  1. Ignore the “file will become unusable” message due to change in file name extension and click Yes. An empty batch file (.bat) has now been created with no contents. You can modify the contents of this file as shown in the following sections.
Batch Files Windows11 Renamed File Unusable

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

Batch Files Windows11 New Created Batch File

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.

There are two ways to operate a .bat file with Notepad. In the first method shown below, open Notepad in Administrator mode from the Start menu.

Batch Files Windows11 Notepad Open As Admin 1

Open the .bat file in Notepad from its saved folder location, and its contents will be populated.

Batch Files Windows11 Batch File Open Admin Mode Notepad

Another direct way to work with a .bat file is to right-click the created .bat file, which allows you to “Edit using Notepad.” In Windows 10, it can be accessed directly with a right-click. In Windows 11, you have to click “Show more options” to see the Notepad option among other programs.

Batch Files Windows11 Show More Options

Once the Notepad file is opened, enter the following to create folders using folder names, then save the file and exit Notepad.

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.

Batch Files Windows11 Folders Command

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

Batch Files Windows11 New Folders Created

To create subfolders in any folder, modify the above code as shown here by mentioning the subfolder names after the folder name. Save the file and exit Notepad, then double-click the .bat file again.

Batch Files Windows11 Batch File Subfolders Created Notepad

As shown here, the subfolders have been created.

Batch Files Windows11 Subfolders Created Within Folder

Move Files From One Folder to Another Using Batch Files

You can use .bat files to move files from any folder on your Windows PC to a destination folder of your choice. All you need is a proper folder path to complete the transfers in a bulk folder move.

The best way to know a folder’s path is to right-click and select “Properties” followed by “Location.” Copy-paste the location entirely into the bat. file.

Batch Files Windows11 Batch File Entire Folder Path

To batch move files in a folder, we are using the “move” command.

As shown here, we are moving all the contents of “Folder A” to “Folder B.” The command is as follows:

Here, *.* is a wildcard that tells Windows 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 Windows11 Move Files One Folder To Another

Save the file and exit Notepad. The entire contents of one folder have been moved to another by double-clicking the .bat file.

Batch Files Windows11 Files Moved Another Folder

If you want to move only select files, the code can be slightly modified by putting the file name ahead of *.* as shown below.

Batch Files Windows11 Specific File Moved

If you wish to move only specific file types between the folders, for example, .png files, modify the code by putting the filetype ahead of *.* as shown below.

For example, to move all image files with .png extension, use the code below:

Batch Files Windows11 Filetype Move Command Png Example

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

Batch Files Windows11 Specific File Tyoe Moved New Folder

You can replace the .png in the above example with .jpg, .pdf, .doc, .ppt, or any other file type you want to move.

Frequently Asked Questions

1. Can I use a batch file to rename multiple files?

Yes, you can, but a batch file isn’t necessary, as there are simpler ways to batch rename files in Windows.

2. Can batch files be dangerous?

Not all batch (.bat) files are dangerous. The ones you create don’t harm your system, as they run a legitimate script.

However, malware authors often use known Windows processes to infect healthy systems. Batch files execute a series of commands that cannot be stopped once the files have been double-clicked. This makes them a popular means to infect Windows systems. Most malicious .bat files, however, will not be allowed to download on your PC provided you haven’t disabled the SmartScreen filter.

When a malicious batch file does creep into your Downloads folder, Windows Defender will automatically alert you. If the .bat script is programmed to run on a double-click, it will be quarantined by Windows Defender.

3. Can I run a batch file as a startup program?

Yes. You can easily program a batch file to run each time Windows boots up. First, create a shortcut for the .bat file using a right-click. This shortcut can be saved on the desktop or anywhere else that’s convenient.

Paste the shortcut into the Windows Startup folder found at “C:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup.” You can also use the same Startup folder to remove the batch file from the startup programs list.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox