Jump to content

Filecopy failed when file is in use.


Recommended Posts

hello all. i have this compiled script and i put a function like UPDATE. this function will copy and overwrite the new files, icons and as well the new compiled exe. when i run the script, filecopy failed to copy the new files when the compiled script is still running. is there a way to copy or forced the Filecopy operation while it is still being used?

Link to comment
Share on other sites

Not if the files are in use (I think)

You should consider a separate "updater" script

yap i mean not the files in use but the compiled exe instead. yeah i am thinking to separate the update but it is only a filecopy operation that i want to include in the whole script. i am thinking like this in the update script...

$PID = ProcessExists("compile.exe") 
If $PID Then 
 ProcessClose($PID)
FileCopy($source, @systemdir, 1)
Run(@systemdir & "\compile.exe)
EndIf

But I never get past the FileCopy because process of the compiled exe has been closed before filecopy will be executed...

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