本文介绍了基于文件夹结构移动子文件夹的VB脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对 VB 脚本非常陌生,我需要 VB 脚本根据文件夹名称结构移动特定的子文件夹(即从test2"中提取确切的abc"子文件夹并需要移动到test1")和文件夹的确切结构如下
I am very new to VB Script and I am in need of VB Script to move specific sub-folder based on folder name structure (i.e. pick-up of exact "abc" sub-folder from "test2" and need to move to "test1") and folder exact structure is as follows
- E:\test1\42\5423284\4967957\html
- E:\test1\43\5403284\4567051\html
- E:\test1\48\7723589\9977457\html
- E:\test1\47\5428284\2797932\html
- E:\test1\42\5468284\1487651\html
在上面,html"文件夹不包含任何abc"子文件夹
In above, "html" folder does not contain any "abc" sub-folder
我想将abc"子文件夹下方移动到html"文件夹上方
I want to move below "abc" sub-folder to above "html" folder
- E:\test2\42\5423284\4967957\html\abc
- E:\test2\43\5403284\4567051\html\abc
- E:\test2\48\7723589\9977457\html\abc
- E:\test2\47\5428284\2797932\html\abc
- E:\test2\42\5468284\1487651\html\abc
任何机构都可以对此提供帮助
Can any body help on this
提前致谢
推荐答案
只需提供如下方法:
Public Function processFolder(oFolder)
WScript.Echo "looking at", oFolder.Path
processFolder = True
If "abc" = oFolder.Name Then
WScript.Echo "will move", oFolder.Path
WScript.Echo " to", Replace(oFolder.Path, "\df\", "\mf\")
oFolder.Move Replace(oFolder.Path, "\df\", "\mf\")
processFolder = False
End If
End Function
这篇关于基于文件夹结构移动子文件夹的VB脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!