completely silent file copy
Hi,
I'm making a backup program and it will be copying over the same file each day so i want to get rid of the "Folder already exsists..overwrite?" prompts
I'm using this as my code
Code:
Private Declare Function SHFileOperation _
Lib "shell32.dll" Alias "SHFileOperationA" _
(lpFileOp As SHFILEOPSTRUCT) As Long
Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End Type
Private Const FO_MOVE = &H1
Private Const FO_COPY = &H2
Private Const FO_DELETE = &H3
Private Const FO_RENAME = &H4
Private Const FOF_SILENT = &H4
and the actual copy bit
Code:
Dim SHF As SHFILEOPSTRUCT
Dim lret As Long
ArrayCount = 1
Do While ArrayCount <= ArrayLimit
SHF.wFunc = FO_COPY
SHF.hwnd = Me.hwnd
SHF.pFrom = Backup(ArrayCount)
SHF.pTo = SaveLocation
SHF.fFlags = FOF_SILENT
lret = SHFileOperation(SHF)
ArrayCount = ArrayCount + 1
Loop
now i thought with the flags set to FOF_SILENT it would not prompt or anything?
Thanks in advance for help!