Hello,
I'm facing a small problem with windows rename (ren) command. I have lot's of files that looks something
like this
1234_1234567_87654321.jpg
Now I need to cut two first parts away.
So the file should look like 87654321.jpg
...but it seems that there is no way to "cut" filename from beginning with easy command or is there?
@echo off & setLocal EnableDELAYedeXpansion for /f "tokens=* delims= " %%a in ('dir/b/a-d *.jpg') do (
for /f "tokens=3 delims=_" %%i in ("%%~Na") do (
ren %%a %%i%%~Xa
)
)
=====================================
Helping others achieve escape felicityM2
I Bow and Thank you!
Works just like dream!Previously I found this, but for some reason it did not work wery well.
@echo on & setlocal EnableDelayedExpansion
for %%j in (*.jpg) do (set file=%%~nxj rename %%j !file:~13!)
:: End_Of_Batch
At first glance, that one knocks off a fixed number of chars. Not what you need.
=====================================
Helping others achieve escape felicityM2
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |