【发布时间】:2014-12-14 16:26:16
【问题描述】:
我需要一些帮助来完成以下任务。我有一个非常大的目录结构,如下所示:
g:\documents\100
g:\documents\100\100001
g:\documents\100\100001\Incoming
g:\documents\100\100001\Workfiles
g:\documents\100\100001\Customer Files
g:\documents\100\100002
g:\documents\100\100002\Incoming
g:\documents\100\100002\Workfiles
g:\documents\100\100002\Customer Files
...
g:\documents\100\100999
g:\documents\100\100999\Incoming
g:\documents\100\100999\Workfiles
g:\documents\100\100999\Customer Files
...
g:\documents\101
g:\documents\101\101001
g:\documents\101\101001\Incoming
g:\documents\101\101001\Workfiles
g:\documents\101\101001\Customer Files
g:\documents\101\101002
g:\documents\101\101002\Incoming
g:\documents\101\101002\Workfiles
g:\documents\101\101002\Customer Files
...
g:\documents\101\101999
g:\documents\101\101999\Incoming
g:\documents\101\101999\Workfiles
g:\documents\101\101999\Customer Files
etc...
我想将 alle 目录的 Incoming 和 Workfiles 移动到具有相同结构的新路径 e.q.: z:\documents 中。
如何遍历所有目录并移动名称等于 Incoming 或 WorkFiles 的完整目录并创建与旧结构相同的结构。
导致:
g:\documents\100
g:\documents\100\100001
g:\documents\100\100001\Customer Files
g:\documents\100\100002
g:\documents\100\100002\Customer Files
...
g:\documents\100\100999
g:\documents\100\100999\Customer Files
z:\documents\100\100001\Incoming
z:\documents\100\100001\Workfiles
z:\documents\100\100002\Incoming
z:\documents\100\100002\Workfiles
...
z:\documents\100\100999\Incoming
z:\documents\100\100999\Workfiles
我想在 VB.NET 中执行此操作,或者是否有可以执行此任务的 robocopy 语法? 其他工具?
提前致谢!
【问题讨论】:
标签: vb.net robocopy directoryinfo