Hallo Zusammen,
ich habe eine Frage, wie ich einen Kopiervorgang angehe:
Mein Vorhaben bzw. Ziel:
Ich möchte gerne einen Ordner in ein Ziel kopieren. _copy("C:\test\quelle\","C:\test\ziel\")
Die bereits vorhanden Dateien bzw. Ordner dürfen nur überschrieben werden, wenn die Quelle neuer ist.
Es muss eine Prozentangabe und ein Prozessbalken geben.
Extra: Man sieht, welche Datei gerade kopiert wird
Extra: Man sieht die Kopiergeschwindigkeit
Extra: Man sieht die noch verbleibende Zeit
Folgende Sachen habe ich bereits ausprobiert:
Spoiler anzeigen
$winShell = ObjCreate("shell.application")
$winShell.namespace($ziel).CopyHere($quelle,$FOF_SIMPLEPROGRESS)
Leider weiß ich hier nicht, wie ich sagen kann, dass nur neuere Dateien kopiert werden sollen.
(wäre aber mal nützlich zu wissen, wenn einer Ahnung davon hat ^^)
Außerdem ist es ungeeignet, da ich eine eigene GUI erzeugen möchte, wo es einen Prozessbalken gibt
--------------------------------------------------------------------------------------------------------
Spoiler anzeigen
$callback = DllCallbackRegister ( "Progress" , "int", "uint64;uint64;uint64;uint64;dword;dword;hwnd;hwnd;ptr")
$ptr = DllCallbackGetPtr ( $callback )
GUICtrlSetData($Label2,$sourcefile)
GUICtrlSetData($Label5,$destinationfile)
$Timer = TimerInit()
DllCall("kernel32.dll", "int", "CopyFileExA", "str" , $sourcefile , "str", $destinationfile, "ptr", $ptr , "ptr", 0, "int", 0, "int", 0)
;~ ProgressOff ()
Sleep(500)
GUIDelete()
Func Progress($TotalFileSize, $TotalBytesTransferred, $StreamSize, $StreamBytesTransferred, $dwStreamNumber, $dwCallbackReason, $hSourceFile, $hDestinationFile, $lpData)
;~ If GUIGetMsg() = $Button1 Then Return 1 ; Cancel Copying NICHT MIT GUIGetMSg arbeiten !!!, auch Sleeps nicht machen...
; Button State so verwenden :::
If BitAND(_GUICtrlButton_GetState(GUICtrlGetHandle($Button1)),$BST_PUSHED) = $BST_PUSHED Then Return 1
;~ If WinActive($Form1) And _IsPressed("1B") Then Return 1
Local $percDone = round($TotalBytesTransferred/$TotalFileSize * 100, 0)
GUICtrlSetData($Label9,$TotalBytesTransferred & " Bytes from " & $TotalFileSize)
GUICtrlSetData($Label7,Round((TimerDiff($Timer)/$percDone)*(100-$percDone)/1000,1) & "s") ; Millisekunden pro Prozent * RestProzent / 1000 ( damit Skeunden rauskommen )
GUICtrlSetData($Progress1,$percDone); , round($TotalBytesTransferred/$TotalFileSize * 100, 0) & "%")
EndFunc
[/autoit]
Hier habe ich das Problem, dass ich bis jetzt nur Datei zu Datei und nicht Ordner zu Ordner übertragen kann... aber wir kommen der Sache näher
---------------------------------------------------------------------------------------------------------
Nun kommt das Programm aus diesem Forum. Ich glaube Oscar hat es geschrieben:
https://autoit.de/index.php?page=Thread&threadID=7923
Hier stellt sich die Frage, wie ich es umschreiben kann bzw. meine Anforderungen damit realisieren kann.
Bis jetzt habe ich lediglich die INI-Datei fertig geschrieben. Sie sieht so aus:
Spoiler anzeigen
[Einzelne Programme]
FileZilla = C:\Users\Anna\Anwendungsdaten\FileZilla
Trillian = C:\Program Files (x86)\Trillian
Webentwicklung = E:\Webentwicklung
Spiele = E:\Spiele
Fonts = C:\Windows\Fonts
Windows Sidebar = C:\Users\Anna\AppData\Local\Microsoft\Windows Sidebar
[Firefox]
FF-Hauptverzeichniss = C:\Program Files (x86)\Mozilla Firefox
FF-Anwendungsdaten = C:\Users\Anna\Anwendungsdaten\Mozilla
[Thunderbird]
TB-Hauptverzeichniss = C:\Program Files (x86)\Mozilla Thunderbird
TB-Anwendungsdaten = C:\Users\Anna\Anwendungsdaten\Thunderbird
Alles anzeigen
Somit liest das Script die einzelnen Pfade ein und führt ein Backup aus.
Das Problem werden die Anzeigen mit einem Prozessbalken. Da müsste man Zwei haben.
Aber ich weiß leider nicht, wie ich sowas realisieren kann
Zudem habe ich ja meine eigene GUI, wo es Prozessbalken und Anzeigefelder für die Zeit und so geben wird (noch nicht erstellt)
Und das Script legt mir eine Datei in das Verzeichnis, welche ich nicht haben möchte, bzw. brauche, da das Verzeichnis sich immer ändert.
Ich hoffe, man kann mir helfen... Vielen Dank im Voraus erst einmal... die Anna