Scripts for replacing brackets with parenthesis on folders and filenames

Server Version#: 1.18.7
Player Version#:

Hey all,
Okay, I recently got PMS running but my naming format I guess didn’t agree with the system. It’ll find the correct movie after I manually click “fix match”, but I want to rescan and skip this tedious step.

I have my movies in their unique folders in my “Movies” folder.
“…\Movies > Blah Blah [2020] > Blah Blah [2020] [DVDrip, x264].mp4”

I need to switch the brackets around the year for parenthesis; I’m wanting to keep the brackets around the info, though. I found a script that allows me to rename [2020] to (2020), but that’s only for files that’s located in the same folder as the script. I’m willing to create a script for every year, in every file format, if need be, but I need it to include folders in the renaming as well as all subdirectories.

Here’s the current .BAT script that I need edited:


Setlocal enabledelayedexpansion

Set “Original=[2019]”
Set “Replaced=(2019)”

For %%a in (*.avi) Do (
Set “File=%%a”
Ren “%%a” “!File:%Original%=%Replaced%!”
)


Thanks for any and all help. I know NOTHING about script editing.

You might find it easier with a renaming utility like Bulk Rename Utility or Advanced Renamer.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.