|
Answer» An application is creating ASCII files. Each file begins with 2011 EN the following 4 CARACTERS are variable. I'm LOOKING for a DOS-command which can RENAME this file 2011**** into mytext_8_2011****. I tried the copy and rename command, but it doesn't work.
For EXAMPLE : 20110807 --> mytext_8_20110807
If I do
Rename 2011*.* mytext_8_2011*.*
the result is : mytext_8_2011 and not mytext_8_20110807
The same result for COPY 2011*.* mytext_8_2011*.*
for /f "delims=" %%A in ('dir /b /a-d 2011*.*') do ren "%%A" "mytext_8_%%A"
Thank you !Code: [Select]@echo off for %%a in (2011*.*) do ( ren "%%a" "mytext_8_%%a" )
|