-3
我試圖移動在C中的所有PDF文件:\到H:\如何將所有的PDF文件到另一個目錄
I googled and was not able to find a sufficient answer. Only if you know the exact file name.
我試圖移動在C中的所有PDF文件:\到H:\如何將所有的PDF文件到另一個目錄
I googled and was not able to find a sufficient answer. Only if you know the exact file name.
For Each x In New DirectoryInfo("C:\").GetFiles("*.pdf", SearchOption.TopDirectoryOnly)' or AllDirectories
File.Copy(x.FullName, Path.Combine("H:\", x.Name), False) 'Overwrite = FALSE
Next
For Each x In My.Computer.FileSystem.GetFiles("C:\", FileIO.SearchOption.SearchTopLevelOnly) ' Or SearchAllSubDirectories
If x.EndsWith(".pdf") Then IO.File.Copy(x, "H:\", False) 'Overwrite = FALSE
Next