Jump to content

FileCopy ...


Recommended Posts

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 by legiom455
Link to comment
Share on other sites

  • Moderators

legiom455, you've almost written your pseudocode in your own post:

1. Need to copy a file, w/ overwrite

FileCopy ("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 :oops:

"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

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

  • Moderators

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 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...