Haho2
asked on
a simple file copying utility... problem!
Hi guys,
I am trying to create a simple file copying utility program that copies ALL files from a single directory and sents it to A:> ..Once it fills up the diskette , it is supposed to prompt the user to insert a new diskette and resume copying... however I cannot specify the wildcard
*.* as the files to be copies.... how do I rectify the problem and will my app. be able to commence copying after the disk prompt... I have included the code for you experts to look at ( and correct :)) .. thanks a lot!!!
The code....
Dim SourceFile, DestinationFile ' declare
On Error GoTo ErrorHandler ' catch error
SourceFile = "c:\temp\*.*" ' <-- the problem *.*!!!
DestinationFile = "a:\*.*"
FileCopy SourceFile, DestinationFile ' Copy source to target.
MsgBox ("File copying completed.")
End
ErrorHandler: ' Error-handling routine.
Select Case Err.Number ' Evaluate error number.
Case ...
< Abort copying and end program >
Case 61 ' Prompt for new disk if disk full
MsgBox ("Disk full. Please enter another disk.")
Resume ' will it continue copying from last point?
End Select
-- end of code summary --
Bye!!
david
I am trying to create a simple file copying utility program that copies ALL files from a single directory and sents it to A:> ..Once it fills up the diskette , it is supposed to prompt the user to insert a new diskette and resume copying... however I cannot specify the wildcard
*.* as the files to be copies.... how do I rectify the problem and will my app. be able to commence copying after the disk prompt... I have included the code for you experts to look at ( and correct :)) .. thanks a lot!!!
The code....
Dim SourceFile, DestinationFile ' declare
On Error GoTo ErrorHandler ' catch error
SourceFile = "c:\temp\*.*" ' <-- the problem *.*!!!
DestinationFile = "a:\*.*"
FileCopy SourceFile, DestinationFile ' Copy source to target.
MsgBox ("File copying completed.")
End
ErrorHandler: ' Error-handling routine.
Select Case Err.Number ' Evaluate error number.
Case ...
< Abort copying and end program >
Case 61 ' Prompt for new disk if disk full
MsgBox ("Disk full. Please enter another disk.")
Resume ' will it continue copying from last point?
End Select
-- end of code summary --
Bye!!
david
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.