I am not sure if it is possible in batch, but then again I never mastered this primitive language... :-P
If CMD isn't mandatory, but you can't use a good file renamer, you can do that with WSH:
var path= "E:/tmp";
var fso = WScript.CreateObject("Scripting.FileSystemObject");
var folder = fso.GetFolder(path);
var files = new Enumerator(folder.files);
for (; !files.atEnd(); files.moveNext())
{
var file = files.item();
var fileName = file.Name;
var p = /^enc(\d+)\.ctl$/.exec(fileName);
if (p != null)
{
var newFileName = "test" + p[1] + ".ctl";
// Optional feedback
WScript.echo(fileName + " -----> " + newFileName);
file.Move(newFileName);
}
}
Of course, put that in a file.js
I actually tested with file.Copy(file.ParentFolder + "/SO/" + newFileName);
to avoid loosing files...
HTH.