Moderators SmOke_N Posted June 16, 2008 Moderators Posted June 16, 2008 (edited) I was working on another project not related to the example script below, when I ran across an issue using FO/FOF constants and CopyFile.Searching the forum I found a couple of examples that used both FOF and CopyFile:http://www.autoitscript.com/forum/index.ph...st&p=471594That being based on Jos's:http://www.autoitscript.com/forum/index.ph...st&p=186168I just need to know if I'm losing my mind, or if the 2nd parameter for CopyFile is not doing its job here and it possibly being a bug.I used this script below to show the issue of the 2nd parameter not working, with $FOF_RESPOND_YES, you should not get a confirmation diealog to overwrite anything on the 2nd pass of _FileCopy()$Source = "FooBar" $Dest = "BarFoo" ;-) For $i = 0 To 9 $dummy = FileOpen(@ScriptDir & "\" & $Source & "\" & $i & ".txt", 2) FileWriteLine($dummy, $i) FileClose($dummy) For $k = 0 To 999 $dummy = FileOpen(@ScriptDir & "\" & $Source & "\" & $i & "\" & $i & "-" & $k & ".txt", 10) FileWriteLine($dummy, $i & $k) FileClose($dummy) Next Next MsgBox(64, "1st copy", "Should go smooth, we didn't ask for a progress, but lets assume it's by default.") _FileCopy(@ScriptDir & "\" & $Source & "\*.*", @ScriptDir & "\" & $Dest & "\") MsgBox(64, "Info", "2nd copy, with $FOF_ you aren't supposed to get a confirmation dialog.") _FileCopy(@ScriptDir & "\" & $Source & "\*.*", @ScriptDir & "\" & $Dest & "\") Func _FileCopy($fromFile, $tofile) If FileExists($tofile) = 0 Then DirCreate($tofile) Local $FOF_RESPOND_YES = 16 Local $FOF_SIMPLEPROGRESS = 256 $winShell = ObjCreate("shell.application") $winShell.namespace($tofile).CopyHere($fromFile, $FOF_RESPOND_YES) EndFunc ;==>_FileCopyThis was tested on:XP Pro SP2 32bitXP Pro SP3 64bitXP Pro SP3 32bitVista Ultimate 32bitAutoIt Versions:3.2.103.2.11.13.2.12Edit:Just for the record, I'm not looking for a DLLCall alternative, I'm sure I could come up with something, I am just looking for confirmation on parameter(s) not accepting/invoking the commands. Unless you have a fix for the above specifically (parameters), please don't post alternative Non-COM methods. Edited June 16, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Developers Jos Posted June 16, 2008 Developers Posted June 16, 2008 I remember something about having this issue but only when using WildCards as Source/Target filename. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Moderators SmOke_N Posted June 16, 2008 Author Moderators Posted June 16, 2008 I remember something about having this issue but only when using WildCards as Source/Target filename.JosThanks Jos, ... truth be known, I didn't even notice the wildcards (that's what being up to late does I suppose). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now