Reputation: 799
I have a directory c:/go , inside go there is tons of folders, subfolders and files.
I need to find inside go, files that start with net*.inf and oem*.inf , and copy the folder, subfolders and all files where they are to another palce at c:/
please help.. thanks
It can also be vbs or any other way to run on the fly using windows...
Upvotes: 0
Views: 4408
Reputation: 29339
BAT files are appropiate for iterating over the contents of a directory with the FOR
command. See HELP FOR
and HELP SET
and try this
for /r %%a in (net*.inf) do (
echo XCOPY %%~pa*.* \destination
)
Repeat the same for oem*.inf
or any other specifications you need.
After testing, remove the ECHO
and adjust the XCOPY
parameters to your appropiate requirements.
EDIT: per OPs comments, changed %%~fa
to %%~pa
to copy the complete folder content,
Upvotes: 2