You can do it with the
renamer tool.
You need to add a script function that will be used to get the folder name. To do that, open the scripts editor, functions menu Scripts>Manage scripts, and create a new script called FolderName with this code in it:
function FolderName() {
var parts = BatchFile.Filename.split('\\');
return parts[parts.length - 2]
}
Or, from the script editor main menu, import the attached FolderName.myscript file.
Close the script editor, saving the changes.
You can now set a rename formula like this:
[FolderName]_
[Counter:1|1|2|A]To get file names as in your example.