How to rename all files in the folder using Windows batch?
Basically, the part of the name starting from _Done
should be removed:
some_file_name_Done_34534576456.CSV
-> some_file_name.CSV
some_other_file_name_Done_23232343.CSV
-> some_other_file_name.CSV
If you don't mind using another language, you can rename with regular expressions. Here's what you asked for in JScript. Save this as something.js, put it in the directory containing your CSV files, and run it with
cscript /nologo something.js
.Try this, solution in Batch:
Edit: changed some
!
to%
for clarification. This doesn't change the effect.