Hey i am trying to get a command in VB that allows me to copy a actual folder from one place to another, but VB 6 only supports FileCopy which copys a file from one location toanother, i have thought about it useing Shell XCOPY, but the problem is if i do that then i am gonig to need it to report back that it has done so the code can continue to run, Also i dont want to use and Refrences, i would rather use API but i dont know a API call for that only for CopyFile, but i have even tryed FileCopy C:\blah\*.* C:\blah2\*.* but it only copied the files that was in the root of blah folder.
Thanks In Advance
Dessip
Page 1 of 1
VB Help Plz
#2
Posted 04 October 2004 - 11:30 PM
#3
Posted 07 October 2004 - 02:52 AM
Try this,
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFolder "C:\Temp", "D:\Temp"
Set fs = Nothing
This copies all subfolders and files from the first path to the second path, note that both folders must exist.
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFolder "C:\Temp", "D:\Temp"
Set fs = Nothing
This copies all subfolders and files from the first path to the second path, note that both folders must exist.
- ← Catch IE system-menu close event
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- Reding/Wrting hard disk →
Share this topic:
Page 1 of 1



Help
Back to top








