Hi everyone.
Please look at this image.
Is it possible to do a batch script that renames these files just to part01.rar, part02.rar, part03.rar, etc.?
Could you please help me?
Batch script to rename a file list without removing the last 6 characters
Moderator: DosItHelp
Re: Batch script to rename a file list without removing the last 6 characters
Save this script in the folder with your rar archives.
Make sure that files have never the same part number!
Steffen
Code: Select all
@echo off &setlocal
for /f "delims=" %%i in ('dir /a-d /b *.rar ^| findstr /reic:"\.part[0-9][0-9]\.rar"') do (
set "file=%%i"
setlocal EnableDelayedExpansion
ren "!file!" "!file:~-10!"
endlocal
)
Make sure that files have never the same part number!
Steffen
Re: Batch script to rename a file list without removing the last 6 characters
Hi Steffen, the script works like a charm, you are the best. Thank you very much for your help.