Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Coping Mulitiple files

Posted on 1998-10-27
1
Medium Priority
?
147 Views
Last Modified: 2010-04-30
How can I copy all the files in a directory to disk a in vb
example:
copy (mydir\*.* a:\
thank you
0
Comment
Question by:sear
1 Comment
 
LVL 1

Accepted Solution

by:
jf26028 earned 40 total points
ID: 1441907
this uses the drive, directory, and file list boxes on a form.


Private Sub Command1_Click()
    Dim i As Integer
    Dim a As String
    Dim b As String
    If File1.ListCount > 0 Then                'if files in the selected dir

        For i = 0 To File1.ListCount - 1            'for all the files
           FileCopy file1.list(i), "c:\whateverdir\" & file1.list(i)
        Next                                        'continue for other files
    End If
End Sub

0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question