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?
- 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.
- After project or department adjustments, batch modifying certain key contents in folder names can prevent confusion caused by old names, impacting our work progress.
- 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:

After processing:

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】.

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.

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.

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

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】.

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.