I want to rename a few files using batch.
I need it to look like DD.MM.YY - # week randomname
,
so let's say 2.7.2013-27.week abcdefg.xls
So far I'm using
for /f "tokens=1-5 delims=/ " %%d in ("%date%") do (
rename "C:\TEST\123.xlsx" %%e%%f%%g.xlsx
)
which comes up with DD.MM.YYYY
and is perfect for the first part.
Can you help with the rest?
Reference: http://quasar.as.utexas.edu/BillInfo/JulianDatesG.html
Windows code for GNU awk:
Example:
This will give you dates, week of year, and you can use !random!!random! with delayed expansion to give you a random filename.
Here's an example script - year month day sorts properly in a folder if that matters to you.
Here is datetime.bat