Solved

Coping Mulitiple files

Posted on 1998-10-27
1
139 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 20 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now