renaming files in windows...perhaps dos command prompt (For) -


this kind of question has been asked few times before on here , have tried use answers in previous posts problem i'm still struggling.

i have in directory 100's of files along lines of

ab00123456.stp ab00123457.stp ab00123458.stp 

...and on

i rename these adding pre , post text file name.

so end result be... cde_ab00123456_a.stp cde_ab00123457_a.stp cde_ab00123458_a.stp ...and on

(note upper , lowercase text change also......as if wasn't difficult enough already!)

any clues appreciated.....along lines of dos command perhaps....

andy

for /? extremely helpful. in particular, contains following substitutions:

%~ni - expands %i file name only
%~xi - expands %i file extension only

thus, create for loop iterates through files iteration variable %i , renames %i cde_%~ni_a%~xi.

ready-to-use example:

for %i in (*) echo rename %i cde_%~ni_a%~xi 

try in directory of choice, fine-tune , remove echo once satisfied.

note translation upper-case much harder, since windows not case sensitive anyway, i'd double-check if really required.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -