To sort a large number of video game ROMs, including removing region identifiers and similar information from filenames, you can use a combination of batch file scripting and command-line tools. Here's a step-by-step guide to help you achieve this:
-
Preparation:
- Create a backup of your ROM collection.
- Open Notepad (or any text editor) and create a batch file named
rename_roms.bat.
-
Batch File Scripting:
- In the
rename_roms.batfile, write the following script:
- In the
@echo off
for /f "tokens=*" %%a in ('dir /b /a-d *.nes') do (
for /f "tokens=1 delims=(" %%b in ("%%~na") do (
set "filename=%%b"
set "filename=!filename:(=!"
set "filename=!filename:)!."
ren "%%a" "!filename!.nes"
)
)
for /f "tokens=*" %%a in ('dir /b /a-d *.snes') do (
for /f "tokens=1 delims=(" %%b in ("%%~na") do (
set "filename=%%b"
set "filename=!filename:(=!"
set "filename=!filename:)!."
ren "%%a" "!filename!.snes"
)
)
- Save the file and close the text editor.
- Running the Batch File:
- Open a Command Prompt window.
- Navigate to the folder containing your ROM collection.
- Run the batch file by typing
rename_roms.batand hitting Enter.
This script will go through all .nes and .snes files in the current directory and remove any region identifiers and parentheses from the filenames.
- Verification:
- Check your ROM collection to ensure the filenames have been updated as expected.
Please note that this script only works for .nes and .snes files. If you have ROMs in other formats, you'll need to create separate scripts for each format.
Also, this script does not handle multiple words in filenames. If you have ROMs with multiple words, you may need to modify the script to handle those cases appropriately.
Finally, ensure that your ROM collection is sorted according to your preference before running the script, as the script only renames the files without changing their order.
References: