I have alot of files in the following format:
C:\Folder1\mkdy0000.bmp
C:\Folder2\mkdy0000.bmp
C:\Folder1\mkdy2074.bmp
I am looking to copy these files in the same directory keeping the numbers but renaming the first 4 chars, for example;
C:\Folder1\sess0000.bmp
C:\Folder2\sess0000.bmp
C:\Folder1\sess2074.bmp
I have the following, it is way off but i think it's heading in the right direction!:
Code: Select all
for /f "tokens=4 delims=y" %%a in ("%%~nf") do (set trunc=%%b)
for %%f in (%1\mkdy*.bmp) do ( copy %1\%%~nf.bmp %1\sess%trunc%.bmp)
Can anyone help?
Many Thanks
Alex