开发者

Batch file to find specifc filenames inside folders and copy them to other place

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.. th开发者_开发问答anks

It can also be vbs or any other way to run on the fly using windows...


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*.infor 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,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜