首先,我是新来的,希望您能提供帮助。我是一名系统工程师,必须从目录中的 500 个文件夹中移动(复制)400 个。文件夹名称为 uniek GUID {f199a57f-fbee-411b-a70e-32619f87e6aa} 命名
是否有 VB 或 C# 方法让用户输入需要复制的文件夹的 400 个名称,让脚本搜索它们并将文件夹复制到新位置?
谢谢您的帮助...
问候, 维姆
我试过了:
我试过这个,但注意到hapens :-(
Sub CopySomeFolder()
Dim FSO, sourceFolder, currentFile, filesInSourceFolder
Dim strSourceFolderPath
Dim strDestinationFolderPath
Dim strUserInput
Set FSO = CreateObject("Scripting.FileSystemObject")
' Figure out which folder to copy from where to where
strUserInput = InputBox("Please enter name of file to copy.")
strSourceFolderPath = "M:\"
strDestinationFolderPath = "M:\"
Set sourceFolder = FSO.GetFolder(strSourceFolderPath)
Set filesInSourceFolder = sourceFolder.Files
' Look at all folders in source folder. If name matches,
' copy to destination folder.
For Each currentFile In filesInSourceFolder
If currentFile.Name = strUserInput Then
currentFile.Copy (FSO.BuildPath(strDestinationFolderPath, _
currentFile.Name))
End If
Next
End Sub