I need a batch.cmd to rename files in the Europe date format

February 28, 2012 at 23:32:43
Specs: Windows XP
I need a batch file to rename a file into "date.csv" the file names has to be translated in the europe/dutch " date" format which is "MM-DD-JJJJ"
how ever on the server configured in English/US date format is like "12/10/2012.csv"
i need this to be for mated in Europe date format " 12-10-2012.csv"

thanks...


See More: I need a batch.cmd to rename files in the Europe date format

Report •


#1
March 1, 2012 at 15:13:29
should test this. set up for a drag and drop with the file at the root directory. if its elsewhere, just need to let me know the full directory and i will switch it.

set c=%1
echo %c%
set a=%c:~3,2%
set b=%c:~6,2%
set d=%c:~8,4%
ren %1 %a%-%b%-%d%.csn
pause

mike


Report •

#2
March 7, 2012 at 01:08:46
Hello Mike,
i did this with the batch file i used the lines as below, and it works grea!
set timestamp=%DATE%
set timestamp=%timestamp:/=-%
rename X:\test.txt "%timestamp%.csv"

thanks for the help!


Report •

Related Solutions


Ask Question