<-- Previous || Up || Next -->

Copy Files Renaming Duplicates Sample Sub
Utilities Class

Private Sub CopyFilesRenamingDuplicatesSample()
    Const strFn = "CopyFilesRenamingDuplicatesSample"

    Dim strSeparator As String
    strSeparator = InputBox("String separator for directory names: ({Esc} cancels.)", strFn, ";")
    If Len(strSeparator) = 0 Then Exit Sub

    Dim strFromDirs As String
    strFromDirs = Replace(GetDOSPath, ";", strSeparator)
    strFromDirs = InputBox("Copy files from directories: ({Esc} cancels.)", strFn, strFromDirs)
    If Len(strFromDirs) = 0 Then Exit Sub

    Dim strToDirectory As String
    strToDirectory = GetTempFileName(Null, strFn)
    strToDirectory = InputBox("Destination directory: (ANY FILE WITH THIS NAME WILL BE DELETED; {Esc} cancels.)", strFn, strToDirectory)
    If Len(strToDirectory) = 0 Then Exit Sub
    If Len(Dir$(strToDirectory)) Then Kill strToDirectory

    MsgBox "This sample subroutine only examines files with Normal attributes; it does NOT examine files which have Hidden and/or System attributes.", vbInformation, strFn
    MsgBox "Return = " & CopyFilesRenamingDuplicates(est, strFromDirs, strToDirectory, strSeparator, vbNormal) & " (True means success; False means failure.)", vbInformation, strFn
    Debug.Print est.MessageText
End Sub

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.