Others

How to Batch Rename Thousands of PDF Files from Excel

Aamir Naveed AkramAamir Naveed Akram Nov 3, 2026 870 views

Question details

The user needs to rename thousands of PDF files automatically using a list of current and desired file names stored in an Excel spreadsheet.

How to Batch Rename Thousands of PDF Files from Excel
Product
Excel
Device & OS
Windows
Scenario
Managing a large number of PDF files that require systematic renaming based on spreadsheet data without doing it manually.
Observed behavior
Renaming thousands of files manually is too time-consuming, necessitating an automated script or batch process using Excel and the operating system.
Before you start

Back up your original PDF files into a separate folder before attempting any bulk renaming, and test the batch process on a small sample of 5 to 10 files first to ensure the script works exactly as expected.

Solution 1Recommended

Use Excel Formulas and Windows Command Prompt

Generate a batch rename script using an Excel formula to combine your old and new file names, then execute it via the Windows Command Prompt (.bat file).

Batch renaming is natively handled by the Windows operating system rather than PDF readers. By using a spreadsheet to write the commands, you can instantly rename thousands of files.

1
Create your list

Open your spreadsheet. In Column A, list the exact current file names (including the .pdf extension). In Column B, list the desired new file names (also including the .pdf extension).

2
Generate the rename command

In Column C (cell C2), enter the formula: ="REN "&CHAR(34)&A2&CHAR(34)&" "&CHAR(34)&B2&CHAR(34) . This creates a command that safely wraps your filenames in quotation marks to handle any spaces.

3
Apply formula to all rows

Select cell C2 and drag the fill handle down to apply this formula to all rows containing your file names.

4
Create the batch file

Select all the generated text in Column C and copy it. Open the Windows Notepad application, paste the copied commands, and go to File > Save As.

5
Save and run the script

Save the file as 'rename_files.bat' directly into the exact folder where your PDF files are located. Double-click this .bat file to execute the script and rename all PDFs instantly.

Use Excel Formulas and Windows Command Prompt
File Extensions Required: Ensure both the current and new file names in your spreadsheet explicitly include the '.pdf' extension to prevent rendering the files unreadable.
Efficient File Management

Batch Rename Files Using WPS Spreadsheet

You can easily generate bulk rename commands using WPS Spreadsheet. It offers full compatibility with Microsoft Excel formulas, allowing you to seamlessly create batch scripts for Windows file management.

  1. 1. Open your file list: Launch WPS Spreadsheet and organize your old file names in Column A and new file names in Column B.
  2. 2. Use the formula: In a blank column, enter the formula ="REN "&CHAR(34)&A2&CHAR(34)&" "&CHAR(34)&B2&CHAR(34) to create the DOS rename command.
  3. 3. Export to Notepad: Copy the output, paste it into Notepad, and save it as a .bat file inside your target PDF directory.
  4. 4. Execute the batch: Run the .bat file to instantly rename your PDFs directly from your Windows folder.
Seamlessly execute standard Excel formulas like Concatenate and CHAR for scriptingFully compatible with Microsoft Excel (.xlsx, .xls) file formatsLightweight, fast, and completely free to use for everyday data managementIntuitive interface for easily managing thousands of rows of data
microsoft office alternative - wps office

Frequently Asked Questions

Do I need to include the .pdf extension in my spreadsheet list?

Yes, both the current filename and the new filename must include the .pdf extension for the Windows Command Prompt to correctly identify and rename the files without losing their format.

What happens if a file name contains spaces?

To handle spaces in file names safely, your rename command must wrap the file names in double quotation marks. Using the formula with CHAR(34) ensures that spaces do not break the command sequence.

Can I use this method to rename files other than PDFs?

Absolutely. The 'REN' command in Windows works for any file type. Just ensure you use the corresponding correct file extension (like .docx, .jpg, or .xlsx) in your spreadsheet columns.

Why didn't my .bat file rename the PDFs?

This usually happens if the .bat file is not saved in the exact same folder as the PDFs, or if the current names in your Excel list do not perfectly match the actual file names on your computer.