Search code examples
windowsbatch-filefile-renamebatch-rename

Renaming multiple files in batch


I need to copy all xlsm files from the May directory into the June directory (that part is easy, I've already done that). My issue is with all the files ending with "May16.xlsm". I want the "May" part of the filename removed and replaced with "Jun".

I can take off the last 5 characters... but I can't figure out how to add them.

I've got 350+ files to rename... and I'd rather not do it manually!


Solution

  • It's not as complex as you thought

    ren May* Jun*
    

    Will work. Or if you want only *.xlsm files

    ren May*.xlsm Jun*.xlsm