|
-
Jul 11th, 1999, 12:02 PM
#1
Thread Starter
New Member
Hi there..
What is the code for diskcopy all files from one selected drive to and other selected drive... for example copy everything from drive A to drive C root directory....?
I try to use the following code in VB6 and I have (div1, drive1 and file1) in my form.
copyfile "a:\*.*", "c:\*.*"
and what is File System Object?
Thank You
Sheley
-
Jul 11th, 1999, 03:32 PM
#2
Files System Object is a DLL (Scripting runtime library) by Microsoft.
Yes, it supports what you ask, copying one directory into another, but then you will have to include this DLL along with your project. There's a VB way to do just that:
Code:
Public Sub CopyFromFloppy()
Dim strFile As String
Dim strDestFile As String
strFile = Dir("A:\*.*")
Do Until strFile = ""
strDestFile = "C:\" & ParseFile(strFile)
FileCopy "A:\" & strFile, strDestFile
strFile = Dir
Loop
End Sub
Public Function ParseFile(pFileName As
String) As String
Do
pFile = Mid$(strFileName, InStr(pFileName, "\") + 1)
Loop While InStr(pFileName, "\") <> 0
ParseFile = pFileName
End Function
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
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
|