Jump to content

VB Help Plz


Recommended Posts

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

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...