|The following is what I understand from your description.|
You want a batch file where you specify a source directory
and a target directory. If the source directory has the same
name as the target directory, then copy all the subfolders of
the source directory to the target directory.
Source: C:\parent1\dir1 (contains subfolders a, b, c)
Target: C:\parent2\dir1 (contains subfolders c, d, e)
Result: since dir1 is the same name, copy subfolders a, b
and c to C:\parent2\dir1. The target will now have subfolders
a, b, c, d, e. The files from the source's c folder will overwrite
those of the target folder's.
Here, the batch file will do nothing, because dir1 is a different
name from dir2.
Is this a correct interpretation of your requirements?
If so, the following might work (I haven't tested it):
if "%~n1" == "%~n2" xcopy /s /e %1\* %2