0

I have currently created the following code, it works fine to copy the contents within the folder 'C:\metadata_home\met_source\metadata\' BUT I need to copy the folder as well. When I use the syntax: copy "C:\metadata_home\met_source\" "%%~ff" it throws up an error saying 'The system cannot find the file specified.'


Setlocal EnableDelayedExpansion
cls
set currentDirectory=%CD%
FOR /D %%g IN ("C:\metadata_home\met_dest\*") DO (
    Pushd %CD%\%%g
    FOR /D %%f IN ("C:\metadata_home\met_dest\*") DO (
        copy "C:\metadata_home\met_source\metadata\" "%%~ff"
    )
Popd
)

pause


Please help I am banging my head against the wall on this one!

4

1 回答 1

0

尝试这个:

xcopy /s C:\metadata_home\met_source\metadata C:\metadata_home\met_dest
于 2013-03-29T13:23:06.383 回答