• Home
  • Training Books
  • Subscribe to Our Email Newsletter
  • About
    • Contributors
    • Feedback
    • Contact
    • Privacy policy
    • Cookie Policy

CADnotes

CAD Tutorials and Best Practices for professionals and students

  • Featured
  • AutoCAD
    • AutoLISP
  • Revit
    • Revit Architecture Basic
    • Revit MEP Basic Tutorial
  • Inventor
  • MicroStation
    • MicroStation Basic Tutorial
You are here: Home / AutoCAD / How to: rename multiple files quickly

How to: rename multiple files quickly

December 12, 2013 by Edwin Prakoso 15 Comments

In this Article...

  • Working with command prompt
    • To open command prompt
    • To navigate to files folder
    • Understanding the wildcards
    • Using rename command
  • Creating a batch file
  • Conclusion

Have you used publish in AutoCAD to create single sheet PDF? AutoCAD will create the file name automatically.

AutoCAD will publish the PDFs by using the layout name. The only option you have is to add file name as prefix. There is no option to create PDFs using file name only.

original file name

Now what if you want to have multiple PDF files that use file name? You can’t.

What you can do is to publish them with format file name and layout name, then rename them. Hai Le shares how this can be done quickly and easily. You can use MS-DOS command “rename” using wildcards.

It has limitation, but if your PDF file name follow a pattern like image above, then you can use this method.

This is not really an AutoCAD tips. We will use command prompt and don’t touch AutoCAD at all.

Working with command prompt

Many people today don’t work with command prompt anymore. So let’s start with some introduction.

To open command prompt

To open command prompt, hold win key + R. Win key is the one on your keyboard with Windows logo.

winkey

This will open run window. Type CMD then press enter.

run window

Now you have command prompt window open. In this window, you can type old school MS-DOS commands like copy, delete or rename.

To navigate to files folder

First thing you need to do is to change the active folder to your PDF location.

You can use CD to change folder (CD stands for change directory. Before Windows, we call it directory instead of folder).

If I want to open c:\data then I can use cd c:\data. You can see the prompt changed to new active folder.

cd dos command

Understanding the wildcards

Before we start to rename the files, let’s try to understand about wildcards first. You need to understand the file name pattern before you can rename your files.

The command to rename file is

rename ORIGINALNAME NEWNAME

Rename A.PDF B.PDF will rename file A.PDF to B.PDF.

But in this case, we want to rename multiple files at once. So we need to use wildcards. We can use wildcards * or ? for this purpose.

To get all file name with a defined name length

If we use ? then it will accept any alphanumeric character.

????.PDF will accept all PDF files that have name with 4 characters long:

  • 1234.PDF
  • S-01.PDF
  • AR01.PDF

To get all file name with undefined name length

The * wildcard will accept all characters regardless how many character they have.

*-Layout1.PDF will accept all files that end with –Layout1.PDF

  • Floor Plan-Layout1.PDF
  • AR01-Layout1.PDF

*-Layout*.PDF will accept all files that has –Layout in the file name, with PDF as file extension.

  • Floor Plan-Layout1.PDF
  • Site Plan-Layout2.PDF
  • Section-Layout14.PDF

Using rename command

Now that we understand how to use wildcards, let’s see how to use rename command with wildcards.

Now let’s see how we can use wildcards when renaming the files.

rename all pdf

The command above will try to find all PDF files, then rename them. It keeps only first 4 characters, ignore the file name after 4th character.

after rename all

We have a small problem. In this example you can see AS-01-Layout01.PDF is renamed to AS-0.PDF. We want the result to be AS-01, not AS-0. We need the result as 5 characters for this particular file.

We need to make a better file name pattern. Let’s try again.

rename some pdf

This command will rename the files as follows

after rename with new pattern

As you can see, the AS-01 was not renamed. You can use rename command again here if you have many files like this. If there’s only one, you can also rename it from File Explorer.

Creating a batch file

If you need to do this regularly, it’s a good idea to create a batch file. Especially if you have multiple file pattern.

You can create a batch file using notepad. Type each command in separate lines like below.

This batch file will run the rename command twice, for 2 different file name pattern.

batch file

After you created it, save it with .bat as file extension. When you save from notepad, use double quote (“) like below.

save batch file

When you need to rename files in a folder, just copy this batch file to the folder. Double click to execute the commands.

Conclusion

Not every problem can be solved from within AutoCAD. Sometimes we need to improve and use other tools. Command prompt and batch file is a great tool, and knowing them will help.

Do you have any other command prompt and batch file experience that you can share with fellow CAD users? Share them here!

Special thanks to Hai Le for the great tip!

About Edwin Prakoso

I work as a Sr. Consultant in PT Cipta Satria Informatika. I've been using AutoCAD since R14 and Revit since Revit Building 9. I occasionally write for AUGIWorld magazine and I am also active in Autodesk discussion forum. I'm a member of Autodesk Expert Elite, an appreciation for individuals who give contributions to the Autodesk community.
Connect with me on twitter or LinkedIn.

Filed Under: AutoCAD, Others Tagged With: PDF, rename

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

15 Comments
Inline Feedbacks
View all comments
jonathan
jonathan
7 years ago

I use, Batch Rename Files Tool. You can easily found hier BatchRenameFiles.org that allows you to quickly rename all the files in a specified directory.

0
Reply
colin mccutcheon
colin mccutcheon
8 years ago

Hi,

your example only allows for the characters at the start of the file name to be kept.

How you adapt the code to keep the last six characters of the file name instead?

Many thanks

0
Reply
Edwin Prakoso
Edwin Prakoso
Author
Reply to  colin mccutcheon
8 years ago

Hi Colin,
You may want to try Bulk Rename Utility. It’s easier to use. And it has preview to let you know the file name after the process is done.

0
Reply
Huong Charles
Huong Charles
9 years ago

I use Ant Renamer on a USB stick.
http://portableapps.com/apps/utilities/ant_renamer_portable
For more complicated renames, it takes some planning and may require several passes but it can be done.

0
Reply
Hoang
Hoang
9 years ago

I found creating batch file very useful but if previous name include space ” “, this didn’t work, Can anyone help me solve this problem. Thank in advance !

0
Reply
Edwin Prakoso
Edwin Prakoso
Author
Reply to  Hoang
9 years ago

Can you give some file names example? I tried file names with spaces, it works fine here.

0
Reply
Hoang
Hoang
Reply to  Edwin Prakoso
9 years ago

@EdwinPrakoso: Thanks , i put double quote mark ” ” and it works :)

0
Reply
Edwin Prakoso
Edwin Prakoso
Author
Reply to  Hoang
9 years ago

Good to know that you figure it out!

0
Reply
Dorian Markich
Dorian Markich
9 years ago

I think you should give KrojamSoft a try. This is what I use all the time when I want to rename/adjust multiple files at once. Plus, it’s a very user-friendly program that has heaps of interesting features that just makes your life so much easier when it comes to organizing and cataloging your photos, music, or anything, basically.

0
Reply
WayneS
WayneS
11 years ago

another method would be with visual lisp, using vl-file-rename

0
Reply
Tawfik Shehata
Tawfik Shehata
11 years ago

"Bulk Rename Utility" is a very powerful utility that can do almost anything you want with multiple file names including generating names from scratch by different indexing methods. The user interface can look a bit intimidating at the beginning and you might better retain a backup of your first rename trial until you get a grip of the utility. The utility can be googled and downloaded from various sites.

0
Reply
Jim LaPier
Jim LaPier
11 years ago

If you are in the Mac, you can use Automator to batch rename files with drag & drop ease. Also, I use PathFinder (a Finder replacement) that has a batch renaming function that is very straightforward.

0
Reply
Edwin Prakoso
Edwin Prakoso
Reply to  Jim LaPier
11 years ago

Thank you for sharing Jim.
I never use Mac, so it's good that someone who does sharing about this.

0
Reply
Paul Munford
Paul Munford
11 years ago

You could also try out a utility called 'Renamer'. Very good programme.

0
Reply
Edwin Prakoso
Edwin Prakoso
Reply to  Paul Munford
11 years ago

Do you have the link Paul?

0
Reply
wpdiscuz   wpDiscuz

Featured

Working with XREF: Introduction

This is the first part of AutoCAD XREF tutorial series. Here we learn about the concept and benefits first.

Recent Articles

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available

Advertisement

New on CADnotes

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available
  • Autodesk Forma Design Contest
  • Revit 2025: Toposolid Enhancements

Meet the Authors

avatar for
avatar for
avatar for
avatar for
avatar for
avatar for

Get Connected

CADnotes on FacebookCADnotes on InstagramCADnotes on TwitterCADnotes on YouTube

© 2009 – 2025 CADnotes · Feedback · Privacy Policy · Become an affiliate

wpDiscuz