I'm thinking about working with a batch file.
I would like to find the files in the file name test and copy only the files to the target directory (dest), although the subdirectories have different hierarchies from the current directory (target).
I would like to use robocopy to copy files because I want to skip errors and leave logs.
Thank you for your cooperation.
It's not a very neat method, but how about the following command?
Copy the subdirectory and then copy the current.
cd [FromDir]
for /d %i in (*) docopy %i [ToDir] *test*
robocopy [FromDir] [ToDir] *test*
If you use for
in the application of the following article, you will be able to do so.
I want to extract all files in the "Designated Directory Name" in "Any Hierarchy" in "Designated Directory"
Is it like this?
for /r TargetDir%I in (*test*.*) drobocopy% to pI DestDir% to nxI
If necessary, add detailed options such as file selection and log output to the end of the robocopy command specification.
However, if the folder name or file name contains spaces, something strange may happen, so be careful or think about it.
© 2024 OneMinuteCode. All rights reserved.