|
-
Sep 18th, 2000, 01:14 PM
#1
Thread Starter
Hyperactive Member
So i have 2 drivelistboxes and a couple of dirlistboxes, how can i select a drive in the first drive list box and have it copy the entire contents over to the selected file in the dirlistbox for the 2nd drivelistbox?
VB6.0 SP4
Windows 2000
I'm thinking of a number between
-
Sep 18th, 2000, 01:38 PM
#2
Try this:
Code:
Dim FSO as FileSystemObject
'Else
'Dim FSO as object
Private Sub Form_Load()
Set FSO = New FileSystemObject
'or if latebound
'Set FSO = CreateObject("scripting.FileSystemObject")
'Syntax is object.MoveFolder source, destination
FSO.MoveFolder "c:\myFolder\","d:\backup\myfolder\"
End Sub
Or this:
Code:
Public Type SHFILEOPSTRUCT
hWnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End Type
Public Const FO_MOVE = &H1
Public Const FO_COPY = &H2
Public Const FO_DELETE = &H3
Public Const FO_RENAME = &H4
Public Const FOF_SILENT = &H4
Public Const FOF_RENAMEONCOLLISION = &H8
Public Const FOF_NOCONFIRMATION = &H10
Public Const FOF_SIMPLEPROGRESS = & H100
Public Const FOF_ALLOWUNDO = &H40
Public Declare Function SHFileOperation _
Lib "shell32.dll" Alias "SHFileOperationA" _
(lpFileOp As SHFILEOPSTRUCT) As Long
Private Sub Command1_Click()
Dim SHF As SHFILEOPSTRUCT
Dim lret As Long
SHF.wFunc = FO_COPY
SHF.hWnd = Me.hWnd
SHF.pFrom = "c:\*.*"
SHF.pTo = "D:\backup\c\"
SHF.fFlags = FOF_SILENT
lret = SHFileOperation(SHF)
'Returns 0 if successful
If lret <> 0 Then
MsgBox "Error"
End If
End Sub
-
Sep 18th, 2000, 01:40 PM
#3
Thread Starter
Hyperactive Member
I'll try both and see how much i can screw up code that probably works fine
VB6.0 SP4
Windows 2000
I'm thinking of a number between
-
Sep 18th, 2000, 03:27 PM
#4
Actually, I think it already displays a progressbar for larger file transfers.
-
Sep 18th, 2000, 03:33 PM
#5
Thread Starter
Hyperactive Member
yes it does in a seperate window,my boss wanted it on the main form, i told him to put it there so we are going with the default one that pops up
VB6.0 SP4
Windows 2000
I'm thinking of a number between
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
|