Windows CMD: Add Suffix to all files in folder



As an IT administrator, you may sometimes find yourself needing to add a suffix to all the files in a folder. If you’re running Windows, you can use the command line to do this in a few simple steps.

The first step is to open the command prompt in the directory containing the files you want to modify. This can be done by pressing Windows+R, typing “cmd”, and pressing enter. Alternatively, you can also open the start menu, type “cmd”, and press enter.

Once you’ve opened the command prompt, you’ll need to enter the following command:

for %f in (*) do ren \%f\ \%f_suffix\

This command will loop through each file in the directory and add the suffix you specified (in this case “_suffix”) to the end of its name.

If you want to rename multiple files with different suffixes, you can use the command:

for %f in (*) do ren \%f\ \%f_new_suffix\

This will add the “_new_suffix” to the end of each file’s name.

In addition to adding a suffix to files, you can also use the command line to add a prefix to a file’s name. To do this, enter the following command:

for %f in (*) do ren \%f\ \prefix_%f\

This will add the “prefix_” to the beginning of each file’s name.

The command line is a powerful tool that can be used to automate many tasks. In this article, we’ve discussed how to use the command line to add a suffix or prefix to all the files in a folder. This can be a useful way to quickly rename multiple files in a directory.

Inquire Now

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Find your next full or part-time role here

ScaleDesk can either help you find your next full time gig or a part time side gig where you can create extra income!

Onboard with us once
Skip HR screening and go to the final interview with with only your resume and a video interview you never have to redo
Get paid electronically every month for the hours you work
We will be your reference even if you work for us once

IT Teams: Use ScaleDesk to augment your team

Schedule Demo