The way to Batch Rename & Mass Delete Information in Home windows

The advent of the super-fast internet brought a variety of files to download. After the advent of digital photography, there was a similar boom in files. Suddenly you can easily fill a 1 terabyte hard drive.

However, tracking files is not always easy. Every now and then you may want to rename every file in a folder for organizational reasons. At other times, you'll want to delete all of your files as well.

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

Batch renaming on Windows 10

There are several ways to batch rename files on Windows 10. You can rename them using File Explorer, Command Prompt, or PowerShell, each option being useful for different tasks.

1. Batch renaming using File Explorer

File Explorer offers one of the easiest renaming options, but also the least amount of flexibility when it comes to renaming.

  1. Go to the folder with the files you want to rename.

  2. Order the files the way you want to rename them.

  3. Press CTRL + A. To select all files in the folder, right click and choose Rename.

  4. Enter your new file name and press Enter. Each file in the folder is given the base file name. In this case Artworkfollowed by a number in a sequence.

Batch rename file explorer number

As you can see, it gets the job done but does not offer any customization.

2. Batch renaming with command prompt

The Windows Command Prompt gives a little more flexibility when renaming batch files. You can use the … ren Command to rename multiple files at once. "Ren" is the abbreviation for "rename". The command allows the wildcard characters "*" and "?" as well as changing file extensions, although you cannot move files to other folders after renaming.

Go to the folder with the files you want to rename and click Shift + right clickand select Open a command window here. Art to you and press Enter to display 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 placeholder acts as any character so the command can look for matching files when it outputs the renamed files.

Batch rename files with a suffix

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

ren *. * ??????? – test. *

In this command, the asterisk wildcard replaces all characters. "*. *" Means to find any file name with any extension in this folder. The second part (with all question marks) instructs the command to use the existing file names of up to seven characters, but add "-test" as a suffix, while the asterisk means that it should be used for any file extension.

Batch rename prompt to add suffix

To add a prefix, move the -test part of the command forward as follows:

ren *. * test – ???????. *

Batches remove parts of a file name

You can also use batch file renaming to delete part of a file name. For example, suppose you have a number of documents named jan-budget.xlsx, feb-budget.xlsx, mar-budget.xlsx, etc. You can remove the -budget suffix with the following command:

ren ??? – budget.xlsx ???. xlsx

Batch renaming of file extensions

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

That means you can try renaming files to similar file types, e.g. B. a Word document (.docx) into a text document (.txt). However, when you try to convert a Word document to a video type, you run into problems (like .mp4).

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

ren * .txt * .rtf

Before exchanging file extensions, I recommend making a backup of the files in case something goes wrong.

3. Batch renaming with PowerShell

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

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

Command Prompt Powershell

Go to the folder that contains the files you want to batch rename and click Shift + right click, then Open a PowerShell window here. Here is our MUO Batch Rename test folder from the previous sections that is now open in PowerShell. Art to you and press Enter to see a list of files.

Powershell Batch rename dir command

From here, you can start using PowerShell to batch rename filenames.

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 contains spaces, you need to enclose the filenames in quotation marks as follows:

Rename element "File name with spaces.jpg" "New file name with spaces.jpg"

Batch replacement of filenames

PowerShell offers several options for batch renaming filenames. One option is to replace part of the file name with another. This is useful for replacing files from a digital camera.

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

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

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

You | Rename-Item –NewName {$ _. Name –replace "_", "-"}

Batch rename files as the number increases

The following command allows you to batch rename files and add a different number to each file.

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

Batch renaming of file names in the entire directory

PowerShell lets you batch rename files throughout the directory, rather than in a single folder. This command works from the top of the file directory down and changes the batch renaming of matching files in each subfolder.

Get-ChildItem -Filter "* current *" -Recurse | Rename-Item -NewName {$ _. Name -replace & # 39; current & # 39 ;, & # 39; old & # 39;}

Get PowerShell Help

These are just a few of the batch renaming options available to PowerShell. If you want more options, you can check PowerShell's built-in samples with the following command:

get-help Rename-Item examples

Batch Renaming on Windows 10 with the Bulk Rename Utility

Bulk renaming program Windows 10

If you want to rename files but don't want to play around with the sometimes confusing commands of PowerShell and Command Prompt, consider the Bulk Renaming utility.

It's a free Windows 10 renaming tool with tons of options. Just make sure to disable the extra tasks during the installation.

Download: Bulk Rename Utility for Windows 10 (Free)

Batch deletion on Windows 10

Now, most people don't have to regularly delete 500,000 files in 45,000 folders, but I'm sure we've all had a moment when your music collection just isn't up to date. Deleting more than a few files using File Explorer can become a tedious process as Windows lists each file before sending it off for packing.

If you want to batch delete files on Windows 10, you have a few options.

1. Batch delete files from the command prompt

There are two powerful file removal commands available to the Command Prompt: DEL and rmdir.

DEL is pretty self-explanatory as a 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 certain types of files, or just remove everything.

Fair warningthe rmdir command is powerful and potentially dangerous. Entire directories are removed, including file structures and everything in between. Pointing out something critical could damage your operating system.

Delete a single file

Use the following command to delete a single file:

del C: Enter your path here / f / s

The base command searches for the specified folder while the / s The parameter deletes all files contained in the directory sub-folders / f The parameter ignores any read-only settings.

Alternatively, go to the folder with the files you want to delete and click Shift + right clickand select Open a command window here. Then type "del (filename)" and press Enter.

Delete a specific type of file

How about if you want to remove a certain type of file from a folder? You can do this with the following command:

del * .extension

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

You can expand the command to delete all specific file extensions from subfolders by adding some parameters:

del / s / q *. extension

Also, if you want to delete multiple types of files, you can add multiple types of extensions:

del / s / q * .png * .svg

Command prompt to batch delete file extensions

Delete a file and remove the folder

The previous commands leave the file structure behind which can be irritating when you want to delete everything in the batch. If you also want to 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

Some more parameters can be seen here. Zero is a special file that discards all data written to it, which means that the somewhat time consuming enumeration process is not written to a file / q selects "quiet mode" which means you won't be prompted to say yes / no before burning your files.

2. Batch delete files with a batch file

A batch file is a script that you can run to perform specific tasks on your system. Knowing how to create a series of commands can help you create a long script that automates tasks to save time. In this case we are going to use some basic commands to do a scripted batch delete.

In this example, I am deleting the MUO Batch Rename folder that was created for the previous examples. Right click on your desktop and go to New> Text document. Name it BatchDelete and open it.

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

If you don't know the correct path for the folder, right-click and select characteristicsand display the location there. Alternatively, you can navigate to the folder and click the address field to see the direct folder path.

Either way, make sure you have the correct folder as it will soon be deleted 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 copying and pasting and adding the path to your folder, select File> Save. Now find your BatchDelete.txt file and press F2 to rename the file. Change the file extension from .TXT to .Bat, and press Enter when you come across a warning.

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

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

How to delete annoying files or "file name too long" errors in Windows 10

Sometimes files can appear that cannot be deleted. Sometimes this is because you are trying to delete a protected system file. If you remove them, the system will be damaged.

In other cases, a file name with too many characters and the following error message may appear:

Cannot delete (filename): The filename you specified is invalid or too long.

You can use Command Prompt to resolve this error. Navigate to the folder with the faulty file and press Shift + right clickand select Open a command window here.

Now enter dir / x to see a list of shortened filenames instead of the full version. In the same command prompt window, you can now delete the files under the nickname.

Command prompt dir x command short filenames

In the picture above I would type del ALTUMC ~ 1.JPG to remove the specific file. Once you've stripped the file names down to their short versions, you can also use the batch delete methods earlier in the article.

You can rename or delete batches

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

Utorrent scandal

7 underground torrent sites to get uncensored content

You need specialized search engines to find legal torrents, foreclosed homes, public records, and even UFOs. Enter the dark web.

About the author

Gavin Phillips
(631 articles published)

Gavin is the junior editor for Windows and Technology Explained, contributing regularly to the Really Useful Podcast, and was the editor for MakeUseOf's crypto-focused sister site Blocks Decoded. He has a BA (Hons) in Contemporary Writing with Digital Art Practices Looted from the Devon Hills and over a decade of writing experience. He enjoys plenty of tea, board games, and soccer.

More from Gavin Phillips

Subscribe to our newsletter

Subscribe to our newsletter for tech tips, reviews, free e-books, and exclusive deals!

One more step …!

Please confirm your email address in the email we just sent you.

. "border =" 0

Leave a Reply

Your email address will not be published. Required fields are marked *