Bonjour,
j’essaye depuis un bon moment de faire une barre de progression pour qu'on puisse voir l'avancer de la copie d'un dossier, j'ai trouver sur le forum un code mais je n'arrive pas à l'adapté pour moi
Func _DirCopy($source,$dest) $oShell=ObjCreate("shell.application") $Shell=$oShell.namespace($dest) $Shell.copyHere($source,256); 256 = affiche la progressbar de windows EndFunc
D'après ce que vous donnez comme infos, $localisation[1] n'est pas une valeur de tableau.
Modifiez l'appel de fonction avec des valeurs valides et cela fonctionnera. ^^
D'après ce que vous donnez comme infos, $localisation[1] n'est pas une valeur de tableau.
Modifiez l'appel de fonction avec des valeurs valides et cela fonctionnera. ^^
Désoler j'avait mal exécuter mon script ce n'est pas cette erreur qu'il m'affiche mais celle-ci :
"C:\Users\Nicolas\Documents\Autoit_Final\Get_Driver\Get_Driver.au3" (74) : ==> The requested action with this object has failed.:
$Shell.copyHere($source,256)
$Shell^ ERROR
Func _DirCopy2($source, $dest)
$oShell = ObjCreate("shell.application")
$oShell.namespace($dest).copyHere($source,256) ; 256 = affiche la progressbar de windows
EndFunc
Ceci-dit, il serait très certainement préférable d'utiliser cell ci-dessous qui est bien plus complète et qui prends en charge la destination inexistante. ^^
;===============================================================================
;
; Function Name: _FileCopy()
; Description: Copies Files and/or Folders with optional animated Windows dialog box
; Parameter(s): $pFrom - Source files/folders to copy from
; $pTo - Destination folder to copy to
; $fFlags - [optional] Defines the flag for CopyHere action
;
; Option Flags: $FOF_DEFAULT = 0 Default. No options specified.
; $FOF_SILENT = 4 Do not display a progress dialog box.
; $FOF_RENAMEONCOLLISION = 8 Rename the target file if a file exists at the target location with the same name.
; $FOF_NOCONFIRMATION = 16 Click "Yes to All" in any dialog box displayed.
; $FOF_ALLOWUNDO = 64 Preserve undo information, if possible.
; $FOF_FILESONLY = 128 Perform the operation only if a wildcard file name (*.*) is specified.
; $FOF_SIMPLEPROGRESS = 256 Display a progress dialog box but do not show the file names.
; $FOF_NOCONFIRMMKDIR = 512 Do not confirm the creation of a new directory if the operation requires one to be created.
; $FOF_NOERRORUI = 1024 Do not display a user interface if an error occurs.
; $FOF_NORECURSION = 4096 Disable recursion.
; $FOF_SELECTFILES = 9182 Do not copy connected files as a group. Only copy the specified files.
;
; Requirement(s): None.
; Return Value(s): No return values per MSDN article.
; Author(s): Jos, commented & modified by ssubirias3 to create $pTo if not present
; Note(s): Must declare $fFlag variables or use their numeric equivalents without declaration. Use BitOR() to combine
; Flags. See http://support.microsoft.com/kb/151799 &
; http://msdn2.microsoft.com/en-us/library/ms723207.aspx for more details
;
;===============================================================================
Func _FileCopy($pFrom, $pTo, $fFlags = 0)
Local $FOF_NOCONFIRMMKDIR = 512
Local $FOF_NOCONFIRMATION = 16
If Not FileExists($pTo) Then DirCreate($pTo)
$winShell = ObjCreate("shell.application")
$winShell.namespace($pTo).CopyHere($pFrom, BitOR($FOF_NOCONFIRMMKDIR,$FOF_NOCONFIRMATION))
EndFunc