I'm trying to rename the latter part of a file, before the extension, in a batch script.
For instance:   
block1.txt --> block1-%mydate%-%mytime%.txt
block2.zip --> block2-%mydate%-%mytime%.txt
The file name is passed to the program as %1. Only one file name will be changed per run. The program is intended to append a time-stamp to the end of a file, in the form of MMDDYYYY-HHMM.
The first part of the program produces the expression %mydate%-%mytime%. 
I can't for the life of me figure out how to do it in a generic and consistently functional way.
Any help?