PDA

Click to See Complete Forum and Search --> : Copy Directories...


rockies1
Nov 4th, 1999, 01:06 AM
I need to copy directories of files over to a network drive...

They are currently on CDs and need to go to a network drive in a folder to be created before copying. This folder will be the CD name.

For example:
I have a CD named CD215 in my CD drive. On the CD are the folders 1902, 1903, 1904, & 1905 each with several files in them

I need to:
1. Create a folder named CD215 on my network drive (I can do this part)
2. Copy folders 1902, 1903, 1904, & 1905 INCLUDING their contents to the CD215 folder I just created...

Anyone know how to do this?

Thanks!!

------------------
Morgan
rockies1@gvi.net
My Web Page (http://members.xoom.com/Rockies1)

Serge
Nov 4th, 1999, 01:20 AM
Probably the easiest way is to use FileSystem object. So, add a reference to Microsoft Scripting Runtime and use something like this:


Dim oFSO As New FileSystemObject

oFSO.CopyFolder "D:\1902\*", "N:\CD215\"
oFSO.CopyFolder "D:\1903\*", "N:\CD215\"
oFSO.CopyFolder "D:\1904\*", "N:\CD215\"
oFSO.CopyFolder "D:\1905\*", "N:\CD215\"


Where N is a network drive.

NOTE: You would have to include Scripting Runtime (scrrun.dll) with your application when you distribute it.

Regards,

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819




[This message has been edited by Serge (edited 11-04-1999).]

rockies1
Nov 4th, 1999, 01:28 AM
OK, one problem is that the folder names won't be the same on each CD. Is there a way to copy all folders, no matter what their name?

------------------


NEVERMIND....Had I played before I wrote, I would have figured it out...

I go it to work using:
oFSO.CopyFolder "D:\*", "C:\temp\"

Thanks for the great info!!


[This message has been edited by rockies1 (edited 11-04-1999).]