legiom455 Posted March 5, 2012 Share Posted March 5, 2012 (edited) I'm in need of either some help with FileCopy or a link to where I can find more info about this: I've looked in quite a few tutorials, and examples, yet haven't found help about: 1. Need to copy a file, w/ overwrite FileCopy ("esettings_evzap.xml", "esettings.xml", 1) 2. Need to wait until the files gets copied,.... then check the error code: 1, success, 0 fail 3. If Success, then process more code,... otherwise, .. send error message to the screen. ... yep, you guessed it, I'm a big noob,... note: the destination file already exists,... Any help, links,.. most appreciated. I even tried to find a udf,... anything I've found, shows progress bars,... using 100 lines of code or more.... which isn't what I need.... thanks again guys! Allen Edited March 5, 2012 by legiom455 Link to comment Share on other sites More sharing options...
kylomas Posted March 5, 2012 Share Posted March 5, 2012 legiom455, All you need is in the help file. What have you tried and what has not worked? kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 5, 2012 Moderators Share Posted March 5, 2012 legiom455, you've almost written your pseudocode in your own post:1. Need to copy a file, w/ overwriteFileCopy ("esettings_evzap.xml", "esettings.xml", 1) 2. .... then check the error code: 1, success, 0 fail 3. If Success, then process more code,... otherwise, .. send error message to the screen. Why not post the code you have as Klyomas suggests, so we can help you "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
legiom455 Posted March 5, 2012 Author Share Posted March 5, 2012 Well, the below seems to be working,... but now, my question is how do I add error checking? Thanks again for helping!!.... most appreciated! Func legionButton() $done = FileCopy (".Jukeboxeversionsettingsesettings_evzap.xml", ".Jukeboxeversionsettingsesettings.xml", 1) While $done = 0 WEnd $done = FileCopy (".JukeboxevZapsettings_legion.xml", ".JukeboxevZapsettings.xml", 1) While $done = 0 WEnd ShellExecute(".Jukeboxeversion.swf") WinWaitActive("Adobe Flash Player Security") Send("{ENTER}") EndFunc Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 5, 2012 Moderators Share Posted March 5, 2012 (edited) There are numerous ways to do this, checking the return from FileCopy. Why not something like this: legionButton() Func legionButton() $done = FileCopy("C:esettings_evzap.xml", "C:esettings.xml", 1) If $done = "1" Then ShellExecute(".Jukeboxeversion.swf") Else MsgBox(0, "", "File did not copy correctly.") EndIf EndFunc Edited March 5, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
legiom455 Posted March 5, 2012 Author Share Posted March 5, 2012 hmmm,, I have two files I'm copying,... I thought I had to use ... If @error = 0 or something like this Seems like I'm using the wrong thing for "file is copied"... Link to comment Share on other sites More sharing options...
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