Hi Skippybox,
what about xcopy.exe?
I think that would be better.
Your batch file has at least two problems:
Code:
for /F %%a in ('dir /ad /b "%Source%"') do call :Sub %%a
This would give you the left part of the directories, if they contain a blank.
Code:
for /F "tokens=* delims= " %%b in ('dir /a-d /b "%Source%\%*\*.*"') do ^
This code is a little bit better. But it won't work if your file or directory contains two blanks in follow.
I think it would be better if you try this (if you don't like xcopy):
Code:
@echo off
set Source=d:\New
for /F "tokens=* delims=" %%a in ('dir /ad /b /s "%Source%"') do call :Sub "%%a"
goto :eof
:Sub
for /F "tokens=* delims=" %%b in ('dir /a-d /b "%~1\*.*"') do ^
echo copy /y "%~1\%%b" "%~1\Copy of %%b"
pause
goto :eof
In the third line the delimiter is set to nothing so the variable %%a will contain the whole line. Using "dir /b /s" will give you the complete path for all subdirectories, so you don't have to use "%source%\%*....".
The call is changed to "%%a" so the variable is enclosed by double qoutes. This will ensure that only one variable is submitted, and multiple blanks shall work.
The "%*" would give you all parameters separated by one blank. I'm not sure if this will work if you have a directory or file with more than one blank in follow. So it is better to know exactly what you submit, therefore I'll changed to "%~1", which is the first parameter given to the subroutine, but the "~" will remove the enclosing quotes.
I haven't tested this script, but I think this sould work. 
Regards, Nils.