Files categorized by month, project, or customer are prone to losing source information when consolidated across folders. This article uses actual screenshots to explain how to use the "add parent folder name to filename" feature in HeSoft Doc Batch Tool to batch-write parent folder names like 2026-10 into jpg filenames. It can also serve as a naming reference for organizing office files such as doc, docx, and pdf, helping users quickly establish a clear and consistent file naming convention.
Many people, when organizing files, first create folders and then place related files inside. For example, one folder per month: 2026-10, 2026-11, 2026-12; one folder per project; one folder per client. This method works well when the folder structure is intact, but as soon as a file is taken out individually, the filename can become unclear.
For instance, black.jpg, green.jpg, and sun.jpg inside the 2026-10 folder can be identified as belonging to October 2026 through the folder while in the current directory. However, if images from multiple monthly folders are aggregated, the filenames themselves will not automatically carry the 2026-10 information. For large numbers of jpg, png images, or office files like doc, docx, pdf, xlsx, subsequent searching, archiving, and uploading will increase the cost of manual judgment.
The solution is not complicated: batch add the monthly folder name to the filenames. This article uses the 2026-10 folder from the screenshot as an example to introduce how to use HeSoft Doc Batch Tool to add the parent folder name to the beginning of filenames, creating a naming result like 2026-10black.jpg. This way, the filename retains its original name while carrying source directory information, making it more suitable for batch office file management.
Applicable Scenarios: Giving Filenames Month, Project, or Client Source Information
Batch adding parent folder names is especially suitable for scenarios where the directory name itself serves as the classification basis. The following situations are the most common.
First, images and attachments archived by month. Marketing event photos, inspection pictures, reimbursement vouchers, and monthly materials are often saved by month. After writing monthly folder names like 2026-10 or 2026-11 into the filenames, files will not lose their time labels even when they leave the original directory.
Second, materials managed by project number. A project folder might contain Proposal.docx, Quotation.xlsx, Contract.pdf, and SitePhoto.jpg. If the project folder name is added to the front of the filenames, it can quickly distinguish similar materials from different projects, reducing the risk of overwriting due to duplicate names during aggregation.
Third, files categorized by client or store. Files with the same name, such as BusinessLicense.pdf, Contract.doc, Photo1.jpg, often appear in multiple client folders. After adding the parent folder name, the filename will include the client or store identifier, facilitating subsequent handover and retrieval.
Fourth, standardization processing before uploading to a system or sending to others. Many business systems only display filenames and not the local directory structure. If the parent directory is written into the filename in advance, the information is more complete for the recipient, reducing back-and-forth inquiries.
Effect Preview: Before Processing, the Filename Alone Cannot Tell the Month
In the example before processing, there are three folders: 2026-10, 2026-11, and 2026-12. The selected 2026-10 folder contains black.jpg, green.jpg, sun.jpg, tree.jpg, and white.jpg. These filenames have no month prefix; only by their containing folder can one tell they belong to 2026-10.

This naming method is acceptable when the number of files is small and the directory hierarchy is fixed. But in batch office work, files often need to be copied, moved, compressed, uploaded, or merged. Once a file leaves its original folder, the "2026-10" information originally stored in the path becomes invisible. If multiple folders also contain files with the same name, the problem becomes more pronounced.
Effect Preview: After Processing, the Month Folder Name Becomes a Filename Prefix
After processing, the parent folder name appears at the beginning of the filename. In the screenshot, black.jpg in the 2026-10 folder becomes 2026-10black.jpg, green.jpg becomes 2026-10green.jpg, and tree.jpg becomes 2026-10tree.jpg. The main body of the filename is preserved, and the .jpg extension also remains unchanged.

The advantage of this naming result is its intuitiveness: the filename starts with the source folder. Later, when sorting in File Explorer, searching for 2026-10, or aggregating all files into one folder, files for the corresponding month can be quickly located. For materials requiring long-term archiving, this kind of filename is more stable and easier for team members to understand.
Operation Steps: Batch Add Parent Folder Names Using Office Software
The software in the screenshot is " HeSoft Doc Batch Tool ". Its interface divides different office processing tasks into multiple tool categories; the function used this time is related to file names. The entire operation uses a step-by-step process, requiring neither opening files individually nor manually copying folder names.
Step 1: Open the File Name Category, Enter the Add Parent Folder Name Function
On the left side of the software's main interface, you can see that the "File Name" category is selected. The right side displays multiple filename processing functions, the fourth of which is "Add Parent Folder Name to Filename," with the description "Batch add parent folder name to filenames."

The purpose of selecting this function is to let the software automatically extract the parent folder name based on the file path, rather than simply adding a uniform fixed text. For example, the parent folders for D:\test\2026-10\black.jpg and D:\test\2026-11\1.jpg are different. Using this function, they will be added with their respective 2026-10 and 2026-11, instead of all having the same prefix added.
This step is also a prerequisite for ensuring processing accuracy. Since the File Name tools also include functions like "Insert Text into Filename" and "Add Prefix and Suffix to Filename," which are suitable for other scenarios, what this article addresses is adding the parent directory name, so one should enter "Add Parent Folder Name to Filename."
Step 2: Add Files or Import Files from Folder
After entering the function, the top of the page shows a four-step process. The first step is "Select records to process." The top right corner has buttons like "Add Files," "Import Files from Folder," "Clear," and "More." According to the screenshot, multiple jpg file records have already been imported.

The "Name" column in the table shows the current filename, such as black.jpg, green.jpg, sun.jpg; the "Path" column shows the file location, such as D:\test\2026-10\black.jpg; the "Extension" column shows jpg; followed by creation time, modification time, and an action column. The summary display at the bottom shows a record count of 15, indicating that multiple files were imported in one batch for this task.
In this step, it is recommended to focus on verifying three pieces of information: first, whether all files needing processing have been imported; second, whether the path points to the correct month or project folder; third, whether any files not intended for processing have been mixed into the list. If a record does not need processing, it can be removed via the interface's action column; if the list is incorrect, you can use "Clear" and then re-import.
After confirming the list is correct, click "Next" at the bottom of the page to enter the processing options settings.
Step 3: Set to Add Parent Folder Name to the Beginning of Filename
In the second step, "Set Processing Options," you first need to set the "Position." The screenshot shows position options for "Start Position" and "End Position," with "Start Position" currently selected. This means the software will place the parent folder name before the original filename.

Taking black.jpg as an example, after selecting start position, the parent folder 2026-10 will be added in front of black.jpg, resulting in 2026-10black.jpg. This result matches the post-processing screenshot. If end position is selected, the parent folder name will be placed after the filename, suitable for another naming convention.
When managing files by month, project, or client, it is usually recommended to add the parent folder name to the beginning. The reason is that when the file list is sorted by name, files from the same month or project will naturally line up together, making subsequent searching more convenient.
Step 4: Set the Folder Hierarchy Number to Extract the Immediate Parent Directory
Next, set the "Folder Hierarchy Number." In the screenshot, this item is filled with 1. Combined with the path and result, it can be seen that hierarchy number 1 corresponds to the file's immediate parent folder. For D:\test\2026-10\black.jpg, the immediate parent folder is 2026-10.
If your file structure is simply "category folder/file," for example, "month folder/image" or "client folder/document," setting it to 1 as shown in the screenshot is usually correct. If the directory structure is deeper, such as "main directory/client/project/file," you should first test with a small number of files to confirm that the hierarchy number retrieves the exact directory level you want to write into the filename.
On the page, you can also see "Custom Text Left" and "Custom Text Right." The screenshot example shows no extra content filled in, so the final effect is the parent folder name directly connected to the original filename. To avoid unnecessary naming changes, first-time operation can be left empty to achieve a result consistent with the example.
Step 5: Proceed to Save Location and Execute Processing
After completing the processing options, click "Next." The top progress flow shows subsequent steps for "Set save location" and "Start processing." As the provided screenshots do not show details of these two pages, this article does not assume specific buttons or saving rules. In actual use, set the save location according to the software interface prompts, then proceed to start processing.
After processing is complete, open the target folder to view the results. If filenames become formats like 2026-10black.jpg, 2026-10green.jpg, it means the parent folder name has been successfully written into the filenames. For files in other folders, corresponding results will also be generated based on their respective parent folder names.
Common Problems and Precautions
1. Will adding the parent folder name change the file content?
This operation targets the file name. Based on the function name and table information in the screenshot, the processing target is the filename, not the file content. In the example, image files remain jpg, only changing the name from black.jpg to 2026-10black.jpg. For important materials, it is still recommended to test or back up first.
2. Why should a clear folder structure be maintained before processing?
Because the software needs to identify the parent folder based on the file path. If the file itself has been moved to an incorrect directory, or the folder name is irregular, the batch-generated filenames will also be affected. Therefore, before executing the batch rename, confirm that the files are already placed in the correct month, project, or client folders.
3. What happens if the folder hierarchy number is filled incorrectly?
If the hierarchy number does not match the actual directory structure, a folder name that is not the target might be retrieved. The screenshot example fills in 1 to get the immediate parent folder 2026-10. For more complex directories, it is recommended to process 2 to 3 sample files first, confirm the result is correct, and then proceed with the full batch.
4. Do I need to add a hyphen, underscore, or space in the filename?
The example result is 2026-10black.jpg with no extra separator. Whether to add a separator depends on your file naming convention. The interface has "Custom Text Left" and "Custom Text Right" areas that can be used to add fixed text; however, if there is no uniform requirement, leaving it blank reduces unnecessary complexity.
5. What should I note when processing office files like docx, pdf, xlsx?
For materials like Word doc, docx, PDF files, and Excel xlsx, before batch renaming, confirm that the files are not occupied by other programs, and first check the name, path, and extension in the import list. Once a naming rule is applied to a large number of files, subsequent reference paths may change, so important files should be tested cautiously.
Conclusion: Reduce Repetitive Work with Batch Renaming to Build a Clearer File System
Writing monthly folder names or project folder names into filenames is a very practical file management method. It solves the problem of unclear file origins when files leave their original directory and also reduces name conflicts during file aggregation. For large numbers of jpg images, PDF attachments, docx documents, and spreadsheet materials, manually renaming them one by one is inefficient and error-prone, whereas using HeSoft Doc Batch Tool can turn this repetitive operation into a streamlined, batch process.
Following the steps in this article, first select "Add Parent Folder Name to Filename" in "File Name," then import the files, choose start position, set the folder hierarchy number to 1, and finally follow the wizard to complete the save location and start processing. You can batch-obtain new filenames containing the parent folder name. If you are organizing materials across months, projects, or clients, it is recommended to immediately try a test with a small number of files, confirm the rules, and then apply it to all files. This allows you to complete file name standardization more safely and efficiently.