I had a similar situation where I needed to copy a number of folders including the folder names to a destination location, and hoped this question marked answered would help, but it truly does not.
Firstly, there are definitely occasions where one would need this ability and I ran into one when I had to copy folders from C:\Windows\Assembly\GAC_MSIL. Windows Explorer refuses to show this folder, so you have to use a command prompt.
If you are familiar with the GAC folder, you would know that the folder names are non-trivial and easy to get wrong if you mistype.
So creating the directory beforehand is not really an option - unless you use a script - which I ended up using, as this was the only real solution.
First dump the folders you want to copy to a temporary file, this is usually based on some pattern e.g.
dir /B policy* > Folders.txt
Then loop over the entries in the dump and copy to destination. Xcopy will take care of creating a folder if you end the destination argument with a backslash (\)
for /F "tokens=*" %%A in (Folders.txt) do xcopy /E /S %%A C:\Dest\%%A\
Put both these commands in a batch file and run.
Now if only xcopy or robocopy has this built in.
1try to use xcopy – None – 2010-11-01T21:53:08.453