@echo off
pushd c:\temp
for /F "tokens=1* delims=_" %%A in ('dir /a-d /b "myfile_*.*"') do ren "%%A_%%B" "hisfile_%%B"
popd
~bp
@echo off
setlocal enabledelayedexpansion
for %%a in ("myfile_*") do (
set filename=%%a
ren "%%a" "hisfile!filename:~6!"
)
Copy and paste the code into Notepad and save it as say, RENAMEFILES.BAT in the same folder as your files. Then, fire up a DOS session and run the batch file by entering the command:
RENAMEFILES
Open in new window