-
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.
-
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.
-
Okay, thanks, I'll try that.
-
Inbead the path in quotes
file copy chr(34)+FilePath+chr(34), chr(34)+MoveLocation chr(34)