windows - Batch file to detect only part of a filename -


i need snippet of batch file can detect part of filename, rename it. note numbers after filename change randomly "file" same.

example:

filename: file143424

there 1 file needs renamed in folder. script delete older versions of file. instance, put first file inside folder , script in there too. run script, renames file. if put new file in, script, when run again, recognize "file" prefix , rename file after deleting old one.

excuse me. question incomplete, think. want rename "file134342" what?

in comment said: rename "file", works if there one file name. anyway, here is:

for %%f in (file*) ren %%f file 

if not want, give more details (you showld give full details beginning).


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -