How to batch replace multiple keywords in folder names? Share three efficient methods


TranslationEnglishFrançaisDeutschEspañol日本語한국어Update Time2025-07-16 17:57:10

Disclaimer: All images, text, and video content on the website are for reference only and may not be the latest, correct, or accurate. In case of any dispute, please refer to the actual experience effect!

In daily file management, how do you handle situations where a large number of folder names need to be batch-modified, such as updating old folder names left after enterprise or product upgrades, or unifying file naming structures? Manually modifying them one by one is extremely inefficient, and if thousands or tens of thousands of folders need to be renamed, relying on manual work is almost entirely unfeasible. This article introduces three methods for replacing partial text in folder names, helping you learn to master efficient ways to replace multiple keywords in folder names and improve our file management efficiency. Come and try it with me!

When is Batch Modification of Multiple Specified Texts in Folder Names Used?

  1. During internal adjustments of naming conventions in enterprises, batch replacing keywords in folder names can unify formatting, making folder structures more consistent and intuitive, facilitating long-term management and searching.
  2. After project or department adjustments, batch modifying certain key contents in folder names can prevent confusion caused by old names, impacting our work progress.
  3. During system upgrades and file backup migrations, specific text content in folder names may conflict with the new system's naming rules. Batch replacing these keywords can ensure files are recognized and used normally.

Preview of Effects After Batch Replacing Partial Keywords in Folder Names

Before processing:

image-Batch rename folders,batch replace text in folder names,how to batch modify part of folder names

After processing:

image-Batch rename folders,batch replace text in folder names,how to batch modify part of folder names

Method 1: Use HeSoft Doc Batch Tool to Batch Rename Folders

Recommendation Index: ★★★★★

Advantages:

  • Capable of batch processing thousands of files with decent processing speed.
  • Files are processed locally without uploading, fully protecting user privacy.

Disadvantages:

  • Requires software installation on the computer for operation.

Operation Steps:

1. Open 【 HeSoft Doc Batch Tool 】, select 【Folder Name】 - 【Find and Replace Keywords in Folder Names】.

image-Batch rename folders,batch replace text in folder names,how to batch modify part of folder names

2. Click 【Add Folders】 to import the folders requiring keyword replacement, or drag them directly below. After confirming the added folders are correct, click Next.

image-Batch rename folders,batch replace text in folder names,how to batch modify part of folder names

3. On the settings options interface, select 【Exact Text Find】 under the search method. Then, enter the keywords to be replaced in the list below the "Keywords to Find" section, and enter the replacement keywords in the list below the "Replacement Keywords" section, one per line. Click Next again after completion. Then click Browse to select the save location for the processed files.

image-Batch rename folders,batch replace text in folder names,how to batch modify part of folder names

4. After processing is complete, click the red path inside the red box to view the modified folders.

image-Batch rename folders,batch replace text in folder names,how to batch modify part of folder names

Method 2: Use Windows PowerShell Script to Replace Partial Text in Folder Names

Recommendation Index: ★★★☆☆

Advantages:

  • Native support in Windows systems, no need to install additional software.
  • Supports regular expression matching rules, capable of processing folders in bulk.

Disadvantages:

  • Requires basic PowerShell knowledge.
  • Incorrect naming can lead to unintended renaming.

Operation Steps:

1. Select the folders needing processing, hold down the Shift key + right-click, and select 【Open PowerShell window here】.

image-Batch rename folders,batch replace text in folder names,how to batch modify part of folder names

2. Enter the following script.

Get-ChildItem -Directory | Rename-Item -NewName { $_.Name -replace 'old name','new name' }

3. To replace multiple keywords simultaneously, enter the following script.

$replacements = @{
'old name 1' = 'new name 1'
'old name 2' = 'new name 2'
'old name 3' = 'new name 3'
}
Get-ChildItem -Directory | ForEach-Object {
$newName = $_.Name
$replacements.GetEnumerator() | ForEach-Object {
$newName = $newName -replace $_.Key, $_.Value
}
Rename-Item -Path $_.FullName -NewName $newName
}

Method 3: Use Python Script to Automatically Batch Replace Specified Keywords in Folder Names

Recommendation Index: ★★☆☆☆

Advantages:

  • Able to completely customize the replacement logic.
  • Suitable for complex batch renaming needs and can be integrated into automated workflows.

Disadvantages:

  • Requires learning Python programming; users unfamiliar with it face a relatively high learning curve.
  • Must run within a Python environment.

Operation Steps:

1. Create a Python script rename_folders.py.

import os

replace_dict = {
'old name 1' = 'new name 1'
'old name 2' = 'new name 2'
'old name 3' = 'new name 3'
}

for folder in os.listdir('.'):
if os.path.isdir(folder):
new_name = folder
for old, new in replace_dict.items():
new_name = new_name.replace(old, new)
if new_name != folder:
os.rename(folder, new_name)
print(f"Renamed: {folder} → {new_name}")

2. Place the script into the target folder and run it.

python rename_folders.py

By reasonably utilizing the above three methods, we can batch replace keywords in folder names, making our file management efficient and accurate. Users with a very large number of folders to replace, and who need to perform such renaming tasks regularly, can use HeSoft Doc Batch Tool or PowerShell scripts for quick reuse. As demands become increasingly complex nowadays, our processing methods are also being updated. Learning to master the above methods can help us better manage and utilize our digital files.


KeywordBatch rename folders , batch replace text in folder names , how to batch modify part of folder names
Creation Time2025-07-16 13:46:26

Disclaimer: All images, text, and video content on the website are for reference only and may not be the latest, correct, or accurate. In case of any dispute, please refer to the actual experience effect!

Related Articles

Don't see the feature you want?

Provide us with your feedback, and after evaluation, we will implement it for free!