|
-
Jul 17th, 2000, 06:57 AM
#1
Thread Starter
Lively Member
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
-
Jul 17th, 2000, 07:17 AM
#2
Addicted Member
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
-
Jul 17th, 2000, 07:19 AM
#3
Thread Starter
Lively Member
Okay, thanks, I'll try that.
Using VB6 Still Pluging away
-
Jul 17th, 2000, 10:24 AM
#4
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|