Viele Fragen zu CopyHere

  • Hier erstmal der Code:

    [autoit]


    ; Windows - copy with progress
    ; Author - JdeB
    ;~ 4 Do not display a progress dialog box.
    ;~ 8 Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.
    ;~ 16 Respond with "Yes to All" for any dialog box that is displayed.
    ;~ 64 Preserve undo information, if possible.
    ;~ 128 Perform the operation on files only if a wildcard file name (*.*) is specified.
    ;~ 256 Display a progress dialog box but do not show the file names.
    ;~ 512 Do not confirm the creation of a new directory if the operation requires one to be created.
    ;~ 1024 Do not display a user interface if an error occurs.
    ;~ 2048 Version 4.71. Do not copy the security attributes of the file.
    ;~ 4096 Only operate in the local directory. Don't operate recursively into subdirectories.
    ;~ 9182 Version 5.0. Do not copy connected files as a group. Only copy the specified files.
    _FileCopy("C:\Video.avi","C:\Neu")
    Func _FileCopy($fromFile,$tofile)
    Local $FOF_RESPOND_YES = 8
    Local $FOF_SIMPLEPROGRESS = 256
    $winShell = ObjCreate("shell.application")
    $winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES)
    EndFunc

    [/autoit]

    Und jetzt meine Fragen... :D

    1. Wie kann ich mit diesem Code mehrere Dateien kopieren?
    2. Gibt es diesen Code auch für FileDelete, oder so... ?( (Löschen mit Progress)

    Ich hoffe, dass mir irgendjemand helfen kann!! :)

    mfg
    Leo.1906

  • Warum habt ihr alle keine Ahnung, was das Thema betrifft??

    Jedes Mal, wenn man etwas in diese Richtung fragt, bekommt man keine Antwort...

    Hoffe, einer versteht mein Problem und kann mit helfen!

    mfg
    Leo.1906

  • Das mit dem Ordner stimmt schon, aber das ist leider nicht das Gleiche... ;(
    Ich hätte es schon ganz gerne so, wie bei Windows, dass man eben mehrere Dateien auf einemal mit diesem Przess kopieren kann und die Dateien nicht erst vorher in einen extra Ordner packen muss...

    Vielleicht gibt es ja doch noch eine Lösung *hoff* :rolleyes:
    (die Windows-Leute haben es ja schließlich auch geschafft xD)

    Aber da gibt es auch noch diese Funktion, mit der ich mich auch zufrieden geben würde, wenn sie mehrere Dateien kopieren könnte ^^:

    [autoit]


    $sourcefile = "D:\wr_installer_04082008.exe"
    $destinationfile = @ScriptDir & "\wr_installer_04082008.exe"
    ProgressOn ( "Copy....", "Copying file " & StringRegExpReplace ( $sourcefile, ".*\\(.*)\Z", "$1" ))
    $callback = DllCallbackRegister ( "Progress" , "int", "uint64;uint64;uint64;uint64;dword;dword;ptr;ptr;ptr")
    $ptr = DllCallbackGetPtr ( $callback )
    DllCall("kernel32.dll", "int", "CopyFileExA", "str" , $sourcefile , "str", $destinationfile, "ptr", $ptr , "ptr", 0, "int", 0, "int", 0)
    ProgressOff ()
    Func Progress($TotalFileSize, $TotalBytesTransferred, $StreamSize, $StreamBytesTransferred, $dwStreamNumber, $dwCallbackReason, $hSourceFile, $hDestinationFile, $lpData)
    ;~ ConsoleWrite ( $TotalBytesTransferred & @lf )
    $TotalFileSize = $TotalFileSize - 100000
    ProgressSet (round($TotalBytesTransferred/$TotalFileSize * 100, 0) , round($TotalBytesTransferred/$TotalFileSize * 100, 0) & "%"&@CRLF&"Streamsize :"&$TotalBytesTransferred);, 'Kopieren von "'&$hSourceFile&'" nach "'&$hDestinationFile&'"')
    EndFunc

    [/autoit]

    Kann mir einer von euch denn hierzu sagen, wie man damit mehrere Dateien kopiert??

    mfg
    Leo.1906