Hello,
I have a 1000 plus files I need to rename them daily
TST.SON.20101013153011.00059
TST.SON.20101013153019.00004
TST.SON.20101013153019.00005
TST.SON.20101013153019.00009
TST.SON.20101013153019.00010
......
I need those to be renamed by
XY153000.004
XY153000.005
XY153000.009
XY153000.010
XY153000.059
I need only dos commands, Since I am new to windows scripting.
need help.
Thanks
Re: batch scripting
Moderator: DosItHelp
Re: batch scripting
Code: Select all
@echo off
SETLOCAL EnableDelayedExpansion
for %%a in ("TST.*") do (
set "$n=%%~na"& set "$x=%%~xa"
ren "%%a" "XY!$n:~-6,4!00.!$x:~-3!"
)