如何将所有子文件夹移动到另一个文件夹保留树?

How to move all subfolders to another folder preserving tree?

我想使用 VBScript 将所有 子文件夹 与文件一起移动,保留位于 "V:\FTP" 的树到 "V:\FTP\Completed"。

我想排除 "V:\FTP\TEMP1" 和 "V:\FTP\TEMP2" 移动。

我有一个脚本将 "V:\FTP" 中的所有 文件 移动到 "V:\FTP\Completed",不包括 "V:\FTP\folder.jpg":

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("V:\FTP").Files
For Each objFile In objFolder
    If objFile.Name <> "folder.jpg" Then
        objFSO.MoveFile objFile.Path, "V:\FTP\Completed\"
    End If
Next

我的问题是我不明白如何对文件夹做同样的事情。

阅读文档后,这是我的工作脚本:

Dim fso, objFol, objMoveFol

Set fso = CreateObject("Scripting.FileSystemObject")
Set objFol = fso.GetFolder("V:\FTP")

For Each objMoveFol In objFol.SubFolders

If objMoveFol.Name <> "Completed" and objMoveFol.Name <> "TEMP2" and objMoveFol.Name <> "TEMP1" Then

    objMoveFol.move "V:\FTP\Completed\"
End If

Next