The advent of superfast internet brought with it masses of files to download. There was a similar boom in files after the advent of digital photography. Suddenly, you could easily fill a one terabyte hard drive with ease.

However, keeping track of files isn't always easy. Now and then, you might want to rename every file in a folder for the sake of organization. At other times, you'll want to delete all your files, too.

Read on to find out how to batch rename and mass delete files in Windows 10.

How to Batch Rename on Windows 10

There are a few ways you can batch rename files using Windows 10. You can rename using File Explorer, Command Prompt, or PowerShell, with each option useful for different tasks.

1. Batch Rename with File Explorer

File Explorer offers one of the easiest renaming options but also offers the least renaming flexibility.

  1. Head to the folder containing the files you wish to rename.
  2. Order the files how you wish to rename them.
  3. Press CTRL + A to select all the files in the folder, then right-click and select Rename.
  4. Input your new file name, and press Enter. Each file in the folder will take the base file name, in this case, artwork, followed by a number in a sequence.
batch rename file explorer numerate

As you can see, it does the job but doesn't offer any customization.

2. Batch Rename with Command Prompt

The Windows Command Prompt offers a bit more flexibility for batch file renaming. You can use the ren command to rename multiple files simultaneously. "Ren" is short for rename. The command allows for the wildcard characters "*" and "?" as well as changing file extensions, though it doesn't permit you to move files into different folders after renaming.

Head to the folder containing the files you wish to rename, hit Shift + Right Click, and select Open a command window here. Type dir and press Enter to see the list of files.

Rename a Single File

The command to rename a single file is:

        ren filename.jpg newfilename.jpg
    

Rename Digits in Multiple Files

If you want to rename multiple files, you can use the wildcard characters to make changes. For example, if you want to change the number of digits in your file names, you can use the following command:

        ren document??.txt document3??.txt
    

Here, the question mark wildcard acts as any character, allowing the command to find any matching files while outputting the renamed files.

Batch Rename Files with a Suffix

How about adding a suffix to a group of files? You can do that using the following command:

        ren *.* ???????-test.*
    

In this command, the asterisk wildcard acts in place of any characters. So, "*.*" means find any file name, with any extension, in this folder. The second part (with all the question marks) tells the command to use the existing file names up to seven characters, but add "-test" as a suffix, while the asterisk again means apply to any file extension.

command prompt batch rename add suffix

If you want to add a prefix, move the "-test" part of the command to the front, like so:

        ren *.* test-???????.*
    

Batch Remove Parts of a Filename

You can use batch file renaming to delete part of a filename, too. Say you have a series of documents named "jan-budget.xlsx," "feb-budget.xlsx," "mar-budget.xlsx," and so on. You can remove the "-budget" suffix using the following command:

        ren ???-budget.xlsx ???.xlsx
    

Batch Rename File Extensions

The ren command can also address file extensions. That means you can batch rename file extensions. While this is handy, it can cause issues if you rename it to an incompatible file type.

That means you can attempt to rename files to similar file types, such as a Word document (.docx) to a text document (.txt), but you'll run into issues if you attempt to convert a Word document into a video type (such as .mp4).

The following command renames all file extensions from text documents to rich text format documents:

        ren *.txt *.rtf
    

Before swapping out file extensions, I recommend taking a backup of the files just in case something goes wrong.

3. Batch Rename with PowerShell

The Windows PowerShell offers the most flexibility for batch renaming files and is the most powerful renaming tool built into Windows.

Related: Command Prompt vs. Windows PowerShell: What's the Difference?

Head to the folder containing the files you want to batch rename, hit Shift + Right Click, then Open a PowerShell window here. Here is our MUO Batch Rename test folder from the previous sections, now open in PowerShell. Type dir and press Enter to see a list of files.

powershell batch rename dir command

From here, you can begin batch renaming filenames with PowerShell.

Rename a Single File

If you want to rename a single file, use the following command:

        Rename-Item filename.jpg newfilename.jpg
    

If your filename includes spaces, you'll need to use quotation marks around the filenames, like so:

        Rename-Item "file name with spaces.jpg" "new file name with spaces.jpg"
    

Batch Replace Filenames

PowerShell offers a few different options for batch renaming filenames. One option is to replace part of the filename with something else, which is handy for replacing files from a digital camera.

        Dir | Rename-Item –NewName { $_.name –replace "DSC","summer2020" }
    

Where "DSC" is part of the original filename from the digital camera or your smartphone photo folder, and "summer2020" is the output filename.

You can use the same command to replace small snippets of a filename, too. For example, the following command replaces an underscore with a hyphen

        Dir | Rename-Item –NewName { $_.name –replace "_","-" }
    

Batch Rename Files Using Increasing Number

You can use the following command to batch rename files, adding a different number to each file.

        Dir | %{Rename-Item $_ -NewName ("summer2020{0}.jpg" -f $nr++)}
    

Batch Rename Filenames Throughout Entire Directory

One thing you can do with PowerShell is batch rename files throughout an entire directory, rather than a single folder. This command works from the top of the file directory downwards, changing batch renaming matching files in each subfolder.

        Get-ChildItem -Filter "*current*" -Recurse | Rename-Item -NewName {$_.name -replace 'current','old' }
    

Get PowerShell Help

These are just a few of the batch rename options available to PowerShell. If you want more options, you can check out PowerShell's inbuilt examples using the following command:

        get-help Rename-Item –examples
    

Batch Renaming on Windows 10 with the Bulk Rename Utility

bulk renaming utility windows 10

If you want to rename files, but don't fancy messing around with the sometimes confusing commands of PowerShell and the Command Prompt, consider the Bulk Rename Utility.

It is a free renaming tool for Windows 10 with heaps of options. Just make sure to unclick the additional tasks during the installation.

Download: Bulk Rename Utility for Windows 10 (Free)

How to Batch Delete on Windows 10

Now, most people don't have to delete 500,000 files spread over 45,000 folders regularly, but I'm sure we have all had the moment where your music collection is just no longer up to scratch. Deleting anything more than a few files using File Explorer can become a lengthy process as Windows opts to enumerate each file before sending it packing.

When it comes to batch deleting files on Windows 10, you have a few options.

1. Batch Delete Files Using the Command Prompt

The Command Prompt has two powerful file removal commands at its disposal: DEL and rmdir.

DEL is fairly self-explanatory as the command to delete a file, while rmdir is the command to remove an entire directory. You can add parameters to both commands to delete and remove specific types of files or to simply remove everything.

Fair warning, the rmdir command is powerful and potentially dangerous. It removes entire directories, including file structures and everything in-between. If you point it at something critical, you could break your operating system.

Delete a Single File

To delete a single file, use the following command:

        del C:\enter\your\path\here /f /s
    

The basic command locates the specified folder, while the /s parameter will delete all files contained in the directory subfolders, and the /f parameter ignores any read-only settings.

Alternatively, head to the folder containing the files you want to delete, hit Shift + Right Click, and select Open a command window here. Then input "del [filename]" and press Enter.

Delete a Specific File Type

How about if you want to remove a specific file type from a folder? You can do that using the following command:

        del *.extension
    

Swap out "extension" for the file type you want to remove.

You can extend the command to delete all of the specific file extension from subfolders with the addition of a couple of parameters:

        del /s /q *.extension
    

Furthermore, if you want to delete multiple file types, you can add multiple extension types:

        del /s /q *.png *.svg

command prompt batch delete file extensions

Delete a File and Remove Folder

The previous commands leave behind the file structure, which can be irritating if you want to batch delete everything. If you want to also remove the folders along with the files, you can use the following commands:

        del /f /s /q C:\enter\your\path\here > nul

rmdir /s /q C:\enter\your\path\here

There are a couple more parameters on show here. Nul is a special file that discards all data written to it, meaning the somewhat time-consuming enumeration process isn't written to a file, while /q selects "quiet mode," meaning you won't be prompted Yes/No before your files combust.

2. Batch Delete Files Using a Batch File

A batch file is a script you can run to perform certain tasks on your system. If you know how to build a series of commands, you can build a lengthy script that automates tasks to save time. In this case, we will use some basic commands to script a batch delete.

For this example, I'm going to delete the MUO Batch Rename folder created for the earlier examples. Right-click your desktop and head to New > Text Document. Name it BatchDelete and open it.

The batch file example requires you to know which folder you want to delete files in. This sounds obvious, but you need the exact file path of the folder.

If you are unsure of the correct path for the folder, right-click and select Properties, and view the location there. Alternatively, browse to the folder and single click the address box to reveal the direct folder path.

Either way, make sure you have the correct folder because it will soon be wiped clean from your system.

You can copy and paste the following into your batch file. You should replace "enter\your\path\here" with the path to your folder.

        cd C:\enter\your\path\here

del * /S /Q

rmdir /S /Q C:\enter\your\path\here

After you copy and paste and add the path to your folder, select File > Save. Now, locate your BatchDelete.txt file and press F2 to rename the file. Change the file extension from .txt to .bat, and press Enter when you encounter a warning.

Congratulations, you've just made your first batch file!

Please note that you'll have to update the path to the folder when you want to use the batch file again.

How to Delete Nuisance Files or "Filename Too Long" Errors on Windows 10

At times, you might encounter files that cannot be deleted. Sometimes, this is because you're attempting to delete a protected system file, which, if you were to remove it, would cause system corruption.

At other times, you might encounter a file name with too many characters, along with the following error message:

Cannot delete [file name]: The file name you specified is not valid or too long.

You can use the Command Prompt to fix this error. Browse to the folder with the offending file, hit Shift + Right Click, and select Open a command window here.

Now, input dir /x to see a list of shortened file names rather than the full-length version. From the same Command Prompt window, you can now delete the files using the short name.

command prompt dir x command short filenames

In the above image, I would input del ALTUMC~1.JPG to remove the specific file. Once you reduce the filenames to their short versions, you can also use the batch delete methods earlier in the article.

You Can Batch Rename or Batch Delete

Using the tips in this guide, you can now use several different tools to batch rename or batch delete files on Windows 10. The commands in this article are handy but also the tip of the iceberg in many ways.