Results 1 to 4 of 4

Thread: Filecopy issues....

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85

    Question

    I need to copy files from one directory into another one. I'm using the FileCopy command. It is coming back with error number 76 or Path not found. I know that both directories are created and that the program can see what is in the 2 directories. I just don't know why FileCopy can not find the path,

    FilePath = GetFiles & FileName
    Do While FileName <> ""
    If FileName = "" Then
    result = FileFinder(GetFiles)
    count = CInt(result)
    count = count - 1
    FileCopy FilePath, MoveLocation
    answer = 1
    Else
    FileCopy FilePath, MoveLocation
    answer = 1
    End If
    Loop

    MoveFiles = answer

    The files that I'm trying to move are never opened, and are not read only. What the program is supposed to do is look into a directory and if there is a file there then it is to move it into another directory, that is all.

    Using VB6 Still Pluging away

  2. #2
    Addicted Member
    Join Date
    Apr 2000
    Location
    Sheffield, England.
    Posts
    136
    When you're using FileCopy, you not only need the destination path - you also need to include the filename itself.
    Code:
    FileCopy "C:\WINDOWS\DESKTOP\MyFile.txt" to "A:\"
    ...would not work.
    Code:
    FileCopy "C:\WINDOWS\DESKTOP\MyFile.txt" to "A:\MyNewFile.txt"
    ...would create a duplicate of the original file on your A: drive, but with a different name.
    Visual Basic 6 Enterprise Edition + SP4

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85
    Okay, thanks, I'll try that.
    Using VB6 Still Pluging away

  4. #4
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    Inbead the path in quotes

    file copy chr(34)+FilePath+chr(34), chr(34)+MoveLocation chr(34)
    Kurt Simons
    [I know I'm a hack but my clients don't!]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width