Solved

Coping Mulitiple files

Posted on 1998-10-27
1
144 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

759 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