I'm using _ExplorerCopy() with this code:
AutoIt
Local $SHFILEOPSTRUCT, $aFiles, $SourceStruct, $DestStruct, $iSourceList, $iLen $SHFILEOPSTRUCT = DllStructCreate("hwnd hWnd;uint wFunc;ptr pFrom;ptr pTo;int fFlags;" & _ "int fAnyOperationsAborted;ptr hNameMappings;ptr lpszProgressTitle") DllStructSetData($SHFILEOPSTRUCT, "fFlags", $FOF_NO_UI) $aFiles = StringSplit($Source, "|") For $i = 1 To $aFiles[0] $iSourceList &= $aFiles[$i] & Chr(0) Next $iSourceList &= Chr(0) & Chr(0) $iSourceList = StringToBinary($iSourceList) $iLen = BinaryLen($iSourceList) $SourceStruct = DllStructCreate("byte[" & $iLen & "]") DllStructSetData($SourceStruct, 1, $iSourceList) $DestStruct = DllStructCreate("char[" & StringLen($Dest) + 2 & "]") DllStructSetData($DestStruct, 1, $Dest) DllStructSetData($DestStruct, 1, 0, StringLen($Dest) + 1) DllStructSetData($DestStruct, 1, 0, StringLen($Dest) + 2) DllStructSetData($SHFILEOPSTRUCT, "hWnd", 0) DllStructSetData($SHFILEOPSTRUCT, "wFunc", $FO_COPY) DllStructSetData($SHFILEOPSTRUCT, "pFrom", DllStructGetPtr($SourceStruct)) DllStructSetData($SHFILEOPSTRUCT, "pTo", DllStructGetPtr($DestStruct)) DllStructSetData($SHFILEOPSTRUCT, "fFlags", $FOF_NOCONFIRMATION) DllCall("shell32.dll", "int", "SHFileOperation", "ptr", DllStructGetPtr($SHFILEOPSTRUCT)) ;Verify that file was copied. If FileExists($Dest) Then If $pStartup_log <> "" Then _FileWriteLog($pStartup_log, $CalledBy & ": Copied " & $Source & " to " & $Dest, -1);writes to end of file EndIf Else MsgBox(0, $ThisFunc, $Dest & " does not exist.") EndIf Return
But when it finds a file or folder that doesn't exist on the backup drive, it still insists on asking for confirmation. Because I loop through a large array of files, I can't leave it run unattended in case it asks me to click OK. I was hoping that the $FOF_NO_UI param would prevent this.
Is there a way to have it just copy without asking each time?