Jump to content


vb6 file copy


1 reply to this topic

#1 Guest_zap_*

  • Guests

Posted 30 July 2008 - 02:55 PM

Can anyone help me?
am not able to copy the files using the below code..it says path not found. error 76
my folder path doesn't hav spaces....i dont know y its not working

Private Sub cmdcopy_Click()
Dim a As String
Dim d As String
If Dir.Path = Dir1.Path Then
MsgBox ("Choose a different destination path")
GoTo 100
Else
GoTo 10
End If
10:
d = Dir1.Path & "\" ====> 'd:\text\net\'
i = 0
Do While file1.ListCount - 1
a = Dir.Path & "\" & file1.List(i) ====> 'd:\text\ab.i01'
FileCopy a, d
Loop
100:
End Sub

please respond soon.. :(

#2 James

    Advanced Member

  • Veterans
  • PipPipPipPipPipPip
  • 1,212 posts
  • Gender:Male
  • Location:UK

Posted 31 July 2008 - 08:04 AM

Sorry, this forum is for AutoPatcher users, not for VB programmers.
Try one of the well-known VB programming forums.

You might also find File Operations in Visual Basic a useful read.

BTW
I can see at least two errors in your posted code:

1) You don't need an Else nor a GoTo to fall out of an If clause

2) Your parameters to FileCopy are wrong:
[indent]FileCopy source, destination requires a filename for both source and destination.[/indent]
--





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users