←  General Discussion

AutoPatcher Forum

»

vb6 file copy

Guest_zap_* 30 Jul 2008

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.. :(
Quote

James's Photo James 31 Jul 2008

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]
--
Quote