我一直在尝试创建一个VBS,它可以将所有主目录放在服务器上并将它们移动到不同的位置。小例子
C:\ homefolders \ test_person C:\ homefolders \ test_person \ old_home
这是我到目前为止所得到的,但移动部分不起作用......
Call ListFolderContents("C:\Windows\System32\Drivers")
Sub ListFolderContents(path)
set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)
Msgbox folder.path
For each item in folder.SubFolders
ListFolderContents(item.Path)
Next
set folder = Nothing
set fs = Nothing
End Sub
答案 0 :(得分:4)
假设权限没有问题:
set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)
folder.Move newPath
干杯