0

Is there a way natively in Windows to rename multiple selected files in a folder to have a common prefix? Effectively what I want is a way to manually select multiple files, right-click and rename them, but with the option to add a prefix only. I also don't want to install extra software to accomplish this.

I already know about the batch rename by selecting files and pressing F2, but this replaces the entire name and appends a sequential number. I want to keep the current name and only add a prefix.

I also know you can run cmd in the folder and rename files that have common name characters or file attributes, but in my example the files I want to select will not have any shared names and all files in the folder are the same type.

My only solution I can think of is to temporarily move the files to a new folder and batch rename them, then move them back to the original folder. I feel like there has to be a better way than this.

  • gci C:\foo\bar -Filter *.xy | % { rename-item $_.FullName -NewName ("Prefix_" + $_.Name) } – SimonS May 22 at 8:28
2

You may add a batch file (.bat) to the right-click Send menu (link), or as a Send-menu destination (in %USERPROFILE%\SendTo).

The batch file can handle its parameters using a loop:

@echo off
setlocal EnableDelayedExpansion
for %%x in (%*) do ( 
    ...
)

and it can also get the prefix using the SET/P command, then issue the appropriate REN command per each file.

1

There is no built in way, without a batch/powershell script, to rename those files. Especially if they don't have a common pattern you will run into issues. There are various tools you can use to do this but you said you're not willing to install additional software.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.